async-http-client icon indicating copy to clipboard operation
async-http-client copied to clipboard

Compressing Twitter firehose stream

Open yiweil opened this issue 12 years ago • 2 comments

I was trying to enable GZIP compressing by adding Headers "Accept-Encoding : gzip, deflate" into the GET request. But it turns out that when I actually execute the request, I did not get compressed responses. I said so because when I print all the headers I received, I do not get Content-Encoding header. I am trying to figure out what headers of the request that I send when I run httpclient.execute(request, handler) I guess httpclient will have some modification of the headers right, like AsyncHttpClientConfig.setCompressionEnabled(true) does.

Would you please point me to the right way of working with compressed content encoding in terms of both request and response?

Thanks

yiweil avatar Sep 25 '14 01:09 yiweil

Besides, can we specify the HTTP protocol version somewhere?

yiweil avatar Sep 25 '14 01:09 yiweil

Please use the Google Group for asking questions, not the bug tracker. In 1.9 (still in beta), with the Netty provider, setCompressionEnabled becomes set setCompressionEnforced (default false), meaning that compression is always enabled/available, but is by default only triggered by setting the Accept-Encoding.

In 1.8, you have to turn setCompressionEnabled to true.

Request compression is not supported.

HTTP protocol version is 1.1 if you enabled connection pooling (default true), 1.0 otherwise.

slandelle avatar Sep 25 '14 03:09 slandelle