On Mon, Jan 08, 2007 at 03:57:20PM +0100, Gisle Aas wrote:
> LWP already provide a method to decode the content for you:
> 
>   my $content = $response->decoded_content;

Ah, thanks.


> This method will also undo various Content-Encodings for you.
> look at the source for decoded_content you will notice that it parse
> the Content-Type header using:
> 
>        if (my @ct =
> HTTP::Headers::Util::split_header_words($self->header("Content-Type")))
> {
>            ($ct, undef, %ct_param) = @{$ct[-1]};
>            $ct = lc($ct);
>        }

It would be handy to have a charset method.

A few questions.

Since $res->decoded_content decodes encodings, is there any code to
help set Accept-Encoding based on what you use for uncompressing the
content?

I was doing the uncompressing manually, and setting my
Accept-Encoding by first seeing what modules could be loaded.

Think it's safe for my code to test for Compress::Zlib and then add
"gzip, x-gzip, deflate" as Accept-Encoding?


I need to look back at my code, too, as I'm using
IO::Uncompress::RawInflate now for "deflate" -- I was using
Compress::Zlib::uncompress() but it wasn't working -- and switching to
IO::Uncompress solved it.  Must have been my implementation and not
the module after all as you are using Compress::Zlib for deflate.



-- 
Bill Moseley
[EMAIL PROTECTED]

Reply via email to