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.
master
Brian Clozel 11 years ago
parent eb65a37f4b
commit a072b3f20d
  1. 8
      src/asciidoc/index.adoc

@ -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

Loading…
Cancel
Save