I have a Python web client that uses urllib2.  It is easy enough to add HTTP headers to my outgoing requests. I just create a dictionary of the headers I want to add, and pass it to the Request initializer.
However, other "standard" HTTP headers get added to the request as well as the custom ones I explicitly add.  When I sniff the request using Wireshark, I see headers besides the ones I add myself.  My question is how do a I get access to these headers?  I want to log every request (including the full set of HTTP headers), and can't figure out how.
any pointers?
in a nutshell:  How do I get all the outgoing headers from an HTTP request created by urllib2?
see urllib2.py:do_request (line 1044 (1067)) and urllib2.py:do_open (line 1073)
(line 293) self.addheaders = [('User-agent', client_version)] (only 'User-agent' added)
How do you get default headers in a urllib2 Request?