How to get headers in urllib2 response

Johny python at
Sat Sep 15 15:44:36 CEST 2007

Can anyone provide an example how to find out the return code and
header  from an urllib2 request?
For example
response = urllib2.urlopen('').read().strip()
provides data
 but I do not know if the return code was 200 or different.


More information about the Python-list mailing list