in reply to uncompress gzip data in a callback
It'll return a list of allowed encodings. My system has gzip, x-gzip, deflate, and x-bzip2. Then, in your script, you want to set it up something like this:#!/usr/bin/perl use strict; use warnings; use HTTP::Message; my $can_accept = HTTP::Message::decodable(); print $can_accept, "\n";
For compression, I'd stick with Compress::Zlib. The documentation has some examples that might be useful for you.#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $can_accept = HTTP::Message::decodable; my $response = $ua->get('http://www.perlmonks.org', 'Accept-Encoding' => $can_accept, ); print $response->decoded_content(charset => 'none');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: uncompress gzip data in a callback
by Weevil (Novice) on May 03, 2010 at 22:27 UTC | |
by pmqs (Friar) on May 04, 2010 at 10:04 UTC | |
by BrowserUk (Patriarch) on May 04, 2010 at 16:16 UTC | |
by pmqs (Friar) on May 04, 2010 at 16:31 UTC | |
by BrowserUk (Patriarch) on May 04, 2010 at 17:12 UTC | |
|