hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shaun Elliott <javamonke...@gmail.com>
Subject Accept-Encoding:gzip
Date Thu, 25 May 2017 17:13:46 GMT
The following code works in v4.2.x

public class RestClientTest {
    private static final Executor EXECUTOR = Executor.newInstance();

    public static void main(String[] args) throws IOException {
        Request request =
Request.Get("http://www.google.com/").addHeader("Accept-Encoding",
"gzip");
        Response response = request.execute();//        Response
response = EXECUTOR.execute(request);
        Header[] headers = response.returnResponse().getAllHeaders();
        for (Header header : headers) {
            System.out.println(header);
        }
    }
}


Returned in response headers:

Content-Encoding: gzip


But, if I update my version, to 4.3.x+ it no longer works. It appears based
on this comment:

https://issues.apache.org/jira/browse/HTTPCLIENT-816?focusedCommentId=13998604&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13998604

That gzip encoding was only available in 4.2.x. Is this the case, or is
there another explanation? Can we get gzip encoding in versions later than
4.2.x?

Thanks,
Shaun Elliott

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message