摘要:
Python 如何处理server返回gzip压缩过的内容,代码如下:from StringIO import StringIOimport gziprequest = urllib2.Request('http://outofmemory.cn/')request.add_header('Accept-encoding', 'gzip')response = urllib2.urlopen(request)if response.info().get('Content-Encoding') == 'gzip': 阅读全文