hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerdes, Tom" <TGer...@OldRepublicTitle.com>
Subject RE: Response Content Error
Date Wed, 23 Aug 2006 16:59:16 GMT
Thanks!

I will try not sending the header "Accept-Encoding: gzip, deflate" header.  I was trying to
send the exact headers that my Web Browser sends when it connects to the site.

If removing the header does not work I will try the example that you supplied.


-----Original Message-----
From: Ortwin Gl├╝ck [mailto:odi@odi.ch] 
Sent: Wednesday, August 23, 2006 11:55 AM
To: HttpClient Project
Subject: Re: Response Content Error



Gerdes, Tom wrote:
> FINE >> "Accept-Encoding: gzip, deflate[\r][\n]"

Why are you sending this in the first place? Stock HttpClient does NOT 
handle any content encoding.

> FINE << "Content-Encoding: gzip[\r][\n]"

In your case this should do the trick:

InputStream in = method.getResponseAsStream();
Header enc = method.getResponseHeader("Content-Encoding");
if (enc != null && "gzip".equals(enc.getValue())) {
   InputStream in = new GZIPInputStream(in);
}


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


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


Mime
View raw message