httplib HTTP: Logging request message

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tom

    httplib HTTP: Logging request message

    With module httplid, I can do
    conn.request("P OST", "/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
  • tom

    #2
    Re: httplib HTTP: Logging request message

    I guess the easies way to do it is to copy and modify the httplib
    module to log both outgoing and incoming messages.

    Comment

    Working...