getting all HTTP headers from urllib2 Request?

Gabriel Genellina gagsl-py2 at
Tue Mar 3 16:59:28 CET 2009

En Tue, 03 Mar 2009 13:44:12 -0200, cgoldberg <cgoldberg at>  

>> I didn't try it, but the Request Class from urllib2 has a method
>> called, header_items(). That could be what your looking for.
> yes, that method only shows you all the headers added by urllib2.
> there are other headers that are produced by httplib under the covers
> that are added to the outgoing http request.  That is what I am trying
> to get at.

Looking at the httplib sources, the only headers it may add are Host,  
Accept-Encoding: identity, and Content-Length.

Gabriel Genellina

More information about the Python-list mailing list