0

The recommended API for apache httpclient seems to be the HC Fluent API these days. I cannot find an example using gzip encoding for the request or response however.

The tutorial https://hc.apache.org/httpcomponents-client-ga/tutorial/html/fluent.html doesn't mention how to add interceptors which seem to be one way of adding this functionality

I'm happy to use the 'old' HttpPost style API if written against the latest httpclient version (currently 4.5) but these APIs appear to get rewritten and the previous one deprecated frequently meaning previous answers based on these APIs are out of date e.g.

Does Apache Commons HttpClient support GZIP?

Community
  • 1
  • 1
andyd
  • 76
  • 2
  • 6
  • decompressing response is probably the default config. do gzip on request is rather uncommon. – ZhongYu Jul 13 '15 at 22:54
  • For a server to return gzipped content the client has to advertise that it will accept the encoding. Does the fluent API definitely do this without being configured? – andyd Jul 15 '15 at 10:41
  • I'm not familiar with that lib, but it'll be very surprising if it doesn't add `Accept-Encoding: gzip` to requests by default. – ZhongYu Jul 15 '15 at 15:50

0 Answers0