Simple wrapper for HttpUrlConnection that allows for RESTful calls. Thanks to @jesperfj for the code.