From a072b3f20dba0f9b32b5a3936114b3a9c1aef839 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Wed, 14 May 2014 18:04:46 +0200 Subject: [PATCH] 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. --- src/asciidoc/index.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/asciidoc/index.adoc b/src/asciidoc/index.adoc index 3e6bb8f8eb..71ac9b2cd1 100644 --- a/src/asciidoc/index.adoc +++ b/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