3

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:

  1. Debug shows actual content length of the gzipped content. How can I get the original content length?
  2. In debug 'Content-Encoding' seems correct. In httplib2.response it is '-content-encoding'. Why?
  3. Is there any way to access response headers as they are shown by debug output?
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
TestMechanic
  • 163
  • 1
  • 1
  • 11

0 Answers0