Change to http-client library

Implement request and doRequest functions for making requests