Connecting Tech Pros Worldwide Forums | Help | Site Map

Re: Retrieving http headers from HTTPConnection object

Marco Bizzarri
Guest
 
Posts: n/a
#1: Sep 1 '08
On Mon, Sep 1, 2008 at 1:06 PM, jorma kala <jjkk73@gmail.comwrote:
Quote:
Hi,
>
when using httplib for http requests, like for example:
>
>
conn = httplib.HTTPConnection("www.python.org")
conn.request("GET", "/index.html")
>
Is it possible to retrieve the complete http request in string form :
>
>
GET /index.html HTTP/1.1
Host: www.python.org
User-Agent: ...
Accept: ...
Accept-Language:
Accept-Encoding:
Accept-Charset:
Keep-Alive:
Connection:
>
I mean does the HTTPConnection object have a property that stores this ?
or is it retrievable by some other form?
>
Thanks a lot.
--
Looking at the code of HTTPConnection, all that goes through the
_output message (including, therefore, the putheaders) are appended to
the self._buffer list.

Regards
Marco

--
Marco Bizzarri
http://notenotturne.blogspot.com/
http://iliveinpisa.blogspot.com/

Closed Thread