Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 12159 invoked from network); 15 Feb 2011 15:48:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Feb 2011 15:48:07 -0000 Received: (qmail 67692 invoked by uid 500); 15 Feb 2011 15:48:04 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 66698 invoked by uid 500); 15 Feb 2011 15:48:01 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 66475 invoked by uid 99); 15 Feb 2011 15:47:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Feb 2011 15:47:59 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [92.42.190.144] (HELO ok2cons2.nine.ch) (92.42.190.144) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Feb 2011 15:47:49 +0000 Received: from [192.168.42.228] (unknown [213.55.131.191]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ok2cons2.nine.ch (Postfix) with ESMTPSA id 4EC86C0E462 for ; Tue, 15 Feb 2011 16:47:29 +0100 (CET) Subject: Re: Gzip problem ? From: Oleg Kalnichevski To: HttpClient User Discussion In-Reply-To: <30932014.post@talk.nabble.com> References: <30932014.post@talk.nabble.com> Content-Type: text/plain; charset="UTF-8" Date: Tue, 15 Feb 2011 16:47:23 +0100 Message-ID: <1297784843.5455.56.camel@ubuntu> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Tue, 2011-02-15 at 07:38 -0800, CodingForever wrote: > Hi, there > > I am using a piece of code(thanks to oleg) for decoding html data. (chunked > or gzipped vs. ) > when I try to decode the gzipped data it does not work. That gives me > gzipped data. > - I looked the header it contains Content-Encoding: gzip > What is the problem ? > > > SessionInputBuffer inbuffer = new SessionInputBufferMockup(bytes); > HttpResponseParser parser = new HttpResponseParser(inbuffer, > BasicLineParser.DEFAULT, new DefaultHttpResponseFactory(), new > BasicHttpParams()); > HttpResponse response = (HttpResponse) parser.parse(); > EntityDeserializer deserializer = new EntityDeserializer(new > LaxContentLengthStrategy()); > HttpEntity entity = deserializer.deserialize(inbuffer, response); > response.setEntity(entity); > BasicHttpContext context = new BasicHttpContext(); > ResponseContentEncoding processor = new ResponseContentEncoding(); > processor.process(response, context); > System.out.println(EntityUtils.toString(entity)); My bad. The last line should be System.out.println(EntityUtils.toString(response.getEntity())); --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org