libwww-perl / WWW-Mechanize

Handy web browsing in a Perl object
https://metacpan.org/pod/WWW::Mechanize
Other
68 stars 52 forks source link

suggest docs of Accept-Encoding change and on getting all HTTP::Message decodable() #245

Open kryde opened 6 years ago

kryde commented 6 years ago

The docs of WWW::Mechanize mentions under _modify_request that it sets Accept-Encoding: gzip. As a suggestion it could say there what to do if you want to change that for any reason.

I presume the answer would be $mech->add_header('Accept-Encoding' => 'whatever').

I did instead $mech->default_header('Accept-Encoding' => scalar HTTP::Message::decodable()) the same as superclass LWP::UserAgent recommends but found it didn't work - Mechanize somehow looks only at add_header not default_header. I couldn't tell if that was a bug or a feature.

The docs could show what to do to get all HTTP::Message::decodable(), presuming that would in fact work, or wouldn't be the default anyway - though I'm not sure I've seen an actual server giving anything except gzip.