Fix RestTemplate documentation for gzip encoding
Prior to this commit, RestTemplate's documentation advised to a DecompressingHttpClient decorator along with Apache's HttpClient in order to support gzipped responses. Since this is now deprecated as of Apache HttpClient 4.3+, this commits update the documentation with HttpClientBuilder.
This commit is contained in:
@@ -39694,15 +39694,15 @@ the `RestTemplate` as follows:
|
||||
|
||||
[TIP]
|
||||
====
|
||||
Apache HttpClient supports gzip encoding via the `DecompressingHttpClient`. To use it,
|
||||
Apache HttpClient supports gzip encoding. To use it,
|
||||
construct a `HttpComponentsClientHttpRequestFactory` like so:
|
||||
|
||||
[source,java,indent=0]
|
||||
[subs="verbatim,quotes"]
|
||||
----
|
||||
HttpClient httpClient = new DecompressingHttpClient(new DefaultHttpClient());
|
||||
ClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||
RestTemplate template = new RestTemplate(requestFactory);
|
||||
HttpClient httpClient = HttpClientBuilder.create().build();
|
||||
ClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
|
||||
RestTemplate restTemplate = new RestTemplate(requestFactory);
|
||||
----
|
||||
====
|
||||
The general callback interface is `RequestCallback` and is called when the execute
|
||||
|
||||
Reference in New Issue
Block a user