python - httplib2 can I get original response headers -
python - httplib2 can I get original response headers -
here sample code:
http.debuglevel=1 ... response, content = conn.request(target,method,body,headers) print response here result fact in debug (note 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 print.response result (note left few lines here)
{ 'status': '200', 'content-length': '55559', '-content-encoding': 'gzip', 'pragma': 'no-cache', 'content-type': 'application/octet-stream' ... ... } so questions are:
debug shows actual content length of gzipped content. how can original content length? in debug 'content-encoding' seems correct. in httplib2.response '-content-encoding'. why? is there way access response headers shown debug output? python python-2.7 http-headers httplib2
Comments
Post a Comment