Added a generic doRequest method, which can be used to perform any kind
of HTTP request.