Here is my sample code:
http.debuglevel=1
...
response, content = conn.request(target,method,body,headers)
print response
here is the result from the fact I am in debug (note I just left few lines here)
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
...
...
here is the print.response result (note I just left few lines here)
{
'status': '200',
'content-length': '55559',
'-content-encoding': 'gzip',
'pragma': 'no-cache',
'content-type': 'application/octet-stream'
...
...
}
So my questions are:
- Debug shows actual content length of the gzipped content. How can I get the original content length?
- In debug 'Content-Encoding' seems correct. In httplib2.response it is '-content-encoding'. Why?
- Is there any way to access response headers as they are shown by debug output?