Mercurial > hg > egg-tcls
changeset 399:a80de0130e45
fetch_weather: Support gzip encoded content in HTTP requests.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 06 Jan 2017 15:04:12 +0200 |
parents | 6419327df9e7 |
children | f69aff75d1e2 |
files | fetch_weather.pl |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/fetch_weather.pl Thu Jan 05 23:18:28 2017 +0200 +++ b/fetch_weather.pl Fri Jan 06 15:04:12 2017 +0200 @@ -19,7 +19,9 @@ use warnings; use utf8; use LWP::UserAgent; +use HTTP::Message; use HTML::Entities; +use Compress::Zlib; use XML::Simple; use Date::Format; use Date::Parse; @@ -58,6 +60,7 @@ $agent->timeout(20); my $req = HTTP::Request->new(GET => $_[0]); + $req->header('Accept-Encoding' => scalar HTTP::Message::decodable()); return $agent->request($req); }