LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: Bill Moseley Date: Sat Jul 5 10:39:25 2008 Subject: Accept-Encoding defaults
HTTP::Message has a decoded_content() method that will attempt
to uncompress based on the Content-Encoding header in the response.
It's wrapped in an eval which will trap exceptions when trying to
require the modules used to uncompress the content.
It would make sense that I would set Accept-Encoding based on if I
have those modules installed.
Since the list of modules (Compress::Zlib and Compress::Bzip2) is
internal to HTTP::Message, would it make sense to provide a method
that could set the Accept-Encoding based on what HTTP::Message uses?
Something like:
$req->set_default_accept_encoding;
I'm not clear if there's a need to also specify a quality for the
encodings in the Accept-Encoding header.
This can't be the default as it would break existing users.
I often notice code that uses $res->content instead of
$res->decoded_content. Most of the time it seems like users really
want the decoded content.
I kind of wonder why $res->content is not decoded by default (and
provide $res->raw_content for those that need it).
--
Bill Moseley
moseley@hank.org
Sent from my iMutt
| Navigate in group perl.libwww at sever nntp.perl.org | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by PHP Developer
Powered By PHP Consultants |