From ca124a97f840d1fcbd1fcb5ddff284c3a4483c34 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 28 Apr 2008 13:41:55 +0200 Subject: [PATCH] add Accept-Encoding header --- oxutils/net.py | 1 + 1 file changed, 1 insertion(+) diff --git a/oxutils/net.py b/oxutils/net.py index 402b0f1..ca7246c 100644 --- a/oxutils/net.py +++ b/oxutils/net.py @@ -14,6 +14,7 @@ DEFAULT_HEADERS = {'User-Agent': 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9 def openUrl(url, data=None, headers=DEFAULT_HEADERS): url = url.replace(' ', '%20') req = urllib2.Request(url, data, headers) + req.add_header('Accept-Encoding', 'gzip') return urllib2.urlopen(req) def getUrl(url, data=None, headers=DEFAULT_HEADERS):