logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Downloading a page compressed: msg#00081

Subject: Re: Downloading a page compressed
* 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@xxxxxxxxxxxxxxxxxxxxxxxx

for some details.
-- 
Björn Höhrmann · mailto:bjoern@xxxxxxxxxxxx · 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/ 



<Prev in Thread] Current Thread [Next in Thread>