refactored HttpClient#request method