I\'m using the fluent API of HttpClient to make a GET request:
String jsonResult = Request.Get(requestUrl) .connectTimeout(2000) .soc
If you want to use HttpClientBuilder you can use the following sytax:
HttpClientBuilder
HttpClient httpClient = HttpClientBuilder.create() .setDefaultRequestConfig(RequestConfig.custom() .setCookieSpec(CookieSpecs.STANDARD).build()).build();