Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries



Links

Issociate
Impressum

#1: Downloading a page compressed

Posted on 2004-12-30 00:58:17 by orasnita

Hi,

Please tell me how can I use the $request->header() in order to request a
page in compressed format (with gzip).


Thank you.

Teddy

Report this message

Mr Ad

Google

#2: Re: Downloading a page compressed

Posted on 2004-12-30 01:02:29 by derhoermi

* Octavian Rasnita wrote:
>Please tell me how can I use the $request->header() in order to request a
>page in compressed format (with gzip).

HTTP/1.1 uses the "TE" and "Accept-Encoding" headers to specify that the
client supports gzip compression. LWP should take care of the TE header
automatically if the relevant modules are installed, in order to specify
the Accept-Encoding header you can use

$request->header(Accept_Encoding => 'gzip')

Note that LWP does not automatically remove the gzip compression in this
case and that there is no gurantee that the resource will indeed be gzip
compressed by the server. If it is, this should be indicated in the
Content-Encoding header. For some resources it is however common that it
is not indicated in the response that the resource is compressed, see

http://www.w3.org/mid/41b3c1cd.228828328@smtp.bjoern.hoehrma nn.de

for some details.
--
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/

Report this message

#3: Re: Downloading a page compressed

Posted on 2004-12-30 03:58:10 by Andy

On Dec 29, 2004, at 6:02 PM, Bjoern Hoehrmann wrote:
>
> Note that LWP does not automatically remove the gzip compression in
> this
> case

WWW::Mechanize does, however.

xoxo,
Andy

--
Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance

Report this message

#4: Re: Downloading a page compressed

Posted on 2004-12-30 13:42:26 by gisle

Andy Lester writes:

> On Dec 29, 2004, at 6:02 PM, Bjoern Hoehrmann wrote:
> >
> > Note that LWP does not automatically remove the gzip compression in
> > this
> > case
>
> WWW::Mechanize does, however.

And LWP does it if you ask for the $response->decoded_content instead
of $response->content. The decoded_content method was introduced in
LWP-5.802.

Regards,
Gisle

Report this message

#5: Re: Downloading a page compressed

Posted on 2004-12-30 15:37:05 by Andy

>>
>> WWW::Mechanize does, however.
>
> And LWP does it if you ask for the $response->decoded_content instead
> of $response->content. The decoded_content method was introduced in
> LWP-5.802.

I was unaware of this. I'll have to have Mech use LWP's decompression.

xoxo,
Andy

--
Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance

Report this message