httplib HTTP: Logging request message

tom tomkur2006-takehome at yahoo.com
Fri Jun 27 21:17:22 EDT 2008


With module httplid, I can do
conn.request("POST", "/target", params, headers)

Now, I want to log the request message that is sent by the request
method.  I don't don't see a method for that task.  Any suggestion?

For a response, I can log the response message by using the call
method.  Though, I have to get rid of the extra strings "replay: " and
"header: ".

data = response.read()
print data

/***what the print call will output***/
reply: 'HTTP/1.0 204 \r\n'
header: Content-Length: 0



More information about the Python-list mailing list