Python httplib2我可以获得原始响应头吗
以下是我的示例代码:Python httplib2我可以获得原始响应头吗,python,python-2.7,http-headers,httplib2,Python,Python 2.7,Http Headers,Httplib2,以下是我的示例代码: http.debuglevel=1 ... response, content = conn.request(target,method,body,headers) print response 这是我正在调试的结果(注意,我在这里只留下了几行) 这是print.response结果(注意我在这里只留下了几行) 因此,我的问题是: 调试显示gzip内容的实际内容长度。如何获取原始内容长度 在调试中,“内容编码”似乎是正确的。在httplib2.response中,它是'-
http.debuglevel=1
...
response, content = conn.request(target,method,body,headers)
print response
这是我正在调试的结果(注意,我在这里只留下了几行)
这是print.response结果(注意我在这里只留下了几行)
因此,我的问题是:
reply: 'HTTP/1.1 200 OK\r\n'
header: Pragma: no-cache
header: Content-Type: application/octet-stream
header: Content-Encoding: gzip
header: Content-Length: 18480
...
...
{
'status': '200',
'content-length': '55559',
'-content-encoding': 'gzip',
'pragma': 'no-cache',
'content-type': 'application/octet-stream'
...
...
}