Added option to use a custom HttpClient