Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Leif Wessman
September 3, 2004, 6:11 am
rate this thread
Re: How can I make HTTP::Request handle gzipped content?
> How can I make HTTP::Request handle gzipped content? I've tried adding
> a 'HTTP_ACCEPT-ENCODING' => 'gzip, deflate' to LWP::UserAgent, but that
> didn't work.
By handle you mean that it should automatically decompress the content
for you? This is not a feature of LWP yet. It does handle
Transfer-Encoding gzip though.
You can always to it yourself with something like this:
use Compress::Zlib qw(memGunzip);
$res = $ua->get($url);
$content = $res->content_encoding =~ /gzip/i ? memGunzip($res->content)