You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Gaurav Kumar <ga...@gmail.com> on 2014/01/08 09:04:28 UTC

Unable to see response encoding even through "Content-Encoding" header is present

Using HttpClient 4.3-beta2.

Have a look at this httpclient header log (headers only)
http://pastebin.com/kWk6rbJ2

As you can see, the server is responding with Content-Encoding header.

Now, refer to this Java code - http://pastebin.com/i7nhAksb - it simple
prints the headers and a message if content encoding cannot be found. The
output of this code is here- http://pastebin.com/WtkuBsZb


My question is - why HttpClient is not able to see content encoding even
though it's  header log  shows it got the header from server?

Thanks,
Gaurav

Re: Unable to see response encoding even through "Content-Encoding" header is present

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2014-01-08 at 07:17 -0800, Gaurav Kumar wrote:
> So what is the best way to figure out what encoding is being used?
> 

By using a protocol interceptor.

Oleg

> On Jan 8, 2014 2:28 AM, "Oleg Kalnichevski" <ol...@apache.org> wrote:
> >
> > On Wed, 2014-01-08 at 00:04 -0800, Gaurav Kumar wrote:
> > > Using HttpClient 4.3-beta2.
> > >
> > > Have a look at this httpclient header log (headers only)
> > > http://pastebin.com/kWk6rbJ2
> > >
> > > As you can see, the server is responding with Content-Encoding header.
> > >
> > > Now, refer to this Java code - http://pastebin.com/i7nhAksb - it simple
> > > prints the headers and a message if content encoding cannot be found.
> The
> > > output of this code is here- http://pastebin.com/WtkuBsZb
> > >
> > >
> > > My question is - why HttpClient is not able to see content encoding even
> > > though it's  header log  shows it got the header from server?
> > >
> >
> > Content-Length, Content-Encoding, Content-MD5 headers are removed by
> > ResponseContentEncoding as they no longer agree with the properties of
> > automatically decompressed response entity.
> >
> > Oleg
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: httpclient-users-help@hc.apache.org
> >



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Unable to see response encoding even through "Content-Encoding" header is present

Posted by Gaurav Kumar <ga...@gmail.com>.
So what is the best way to figure out what encoding is being used?

On Jan 8, 2014 2:28 AM, "Oleg Kalnichevski" <ol...@apache.org> wrote:
>
> On Wed, 2014-01-08 at 00:04 -0800, Gaurav Kumar wrote:
> > Using HttpClient 4.3-beta2.
> >
> > Have a look at this httpclient header log (headers only)
> > http://pastebin.com/kWk6rbJ2
> >
> > As you can see, the server is responding with Content-Encoding header.
> >
> > Now, refer to this Java code - http://pastebin.com/i7nhAksb - it simple
> > prints the headers and a message if content encoding cannot be found.
The
> > output of this code is here- http://pastebin.com/WtkuBsZb
> >
> >
> > My question is - why HttpClient is not able to see content encoding even
> > though it's  header log  shows it got the header from server?
> >
>
> Content-Length, Content-Encoding, Content-MD5 headers are removed by
> ResponseContentEncoding as they no longer agree with the properties of
> automatically decompressed response entity.
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>

Re: Unable to see response encoding even through "Content-Encoding" header is present

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2014-01-08 at 00:04 -0800, Gaurav Kumar wrote:
> Using HttpClient 4.3-beta2.
> 
> Have a look at this httpclient header log (headers only)
> http://pastebin.com/kWk6rbJ2
> 
> As you can see, the server is responding with Content-Encoding header.
> 
> Now, refer to this Java code - http://pastebin.com/i7nhAksb - it simple
> prints the headers and a message if content encoding cannot be found. The
> output of this code is here- http://pastebin.com/WtkuBsZb
> 
> 
> My question is - why HttpClient is not able to see content encoding even
> though it's  header log  shows it got the header from server?
> 

Content-Length, Content-Encoding, Content-MD5 headers are removed by
ResponseContentEncoding as they no longer agree with the properties of
automatically decompressed response entity.

Oleg 



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org