1WWW::Mechanize::GZip(3)User Contributed Perl DocumentatioWnWW::Mechanize::GZip(3)
2
3
4

NAME

6       WWW::Mechanize::GZip - tries to fetch webpages with gzip-compression
7

VERSION

9       Version 0.10
10

SYNOPSIS

12           use WWW::Mechanize::GZip;
13
14           my $mech = WWW::Mechanize::GZip->new();
15           my $response = $mech->get( $url );
16
17           print "x-content-length (before unzip) = ", $response->header('x-content-length');
18           print "content-length (after unzip) = ", $response->header('content-length');
19

DESCRIPTION

21       The WWW::Mechanize::GZip module tries to fetch a URL by requesting
22       gzip-compression from the webserver.
23
24       If the response contains a header with 'Content-Encoding: gzip', it
25       decompresses the response in order to get the original (uncompressed)
26       content.
27
28       This module will help to reduce bandwith fetching webpages, if
29       supported by the webeserver. If the webserver does not support gzip-
30       compression, no decompression will be made.
31
32       This modules is a direct subclass of WWW::Mechanize and will therefore
33       support any methods provided by WWW::Mechanize.
34
35       The decompression is handled by Compress::Zlib::memGunzip.
36
37       There is a small webform, you can instantly test, whether a webserver
38       supports gzip-compression on a particular URL:
39       http://www.computerhandlung.de/www-mechanize-gzip.htm
40       <http://www.computerhandlung.de/www-mechanize-gzip.htm>
41
42   METHODS
43       prepare_request
44         Adds 'Accept-Encoding' => 'gzip' to outgoing HTTP-headers before
45         sending.
46
47       send_request
48         Unzips response-body if 'content-encoding' is 'gzip' and corrects
49         'content-length' to unzipped content-length.
50

SEE ALSO

52       WWW::Mechanize
53
54       Compress::Zlib
55

AUTHOR

57       Peter Giessner "cardb@planet-elektronik.de"
58
60       Copyright (c) 2007, Peter Giessner "cardb@planet-elektronik.de".  All
61       rights reserved.
62
63       This module is free software; you can redistribute it and/or modify it
64       under the same terms as Perl itself.
65
66
67
68perl v5.12.0                      2009-06-24           WWW::Mechanize::GZip(3)
Impressum