I have the need to use the HttpClient to set certain parameters while using Spring's RestTemplate.
I currently do this via:
HttpClient httpClient = new HttpClient();
httpClient.getParams().setSoTimeout(prefs.getServerTimeout());
httpClient.getParams().setConnectionManagerTimeout(3000);
httpClient.getParams().setContentCharset("UTF-8");
httpClient.getParams().setCredentialCharset("ISO-8859-1", )
...
CommonsClientHttpRequestFactory requestFactory = new CommonsClientHttpRequestFactory(httpClient);
requestFactory.setReadTimeout(prefs.getServerTimeout());
RestTemplate restTemplate = new RestTemplate(requestFactory);
The HttpClient currently used everywhere, and for example in the
HttpComponentsClientHttpRequestFactory.getHttpClient()
Is pointing to the deprecated one shipped with Android.
Since it's deprecated, and removed from Android in 6.0, how do i go about continuing to use a HttpClient object with RestTemplate?
Since they share the same package (org.apache.http.client), i'm not sure how to make this work in pre/post 6.0.
(I tried using httpclient-android and HttpComponentsClientHttpRequestFactory without setting HttpClient, and it then seems to be using CloseableHttpClient. But the method signature is the deprecated HttpClient as mentioned.)
Pointers would be much appreciated.