major refactor in http client for more flexibility and support for basic auth