Re: How to get headers in urllib2 response

2007-09-15 Thread js
How about using httplib? http://docs.python.org/lib/httplib-examples.html HTTPResponse has getheaders() method, too. On 9/15/07, Johny <[EMAIL PROTECTED]> wrote: > Can anyone provide an example how to find out the return code and > header from an urllib2 request? > For example > response = url

How to get headers in urllib2 response

2007-09-15 Thread Johny
Can anyone provide an example how to find out the return code and header from an urllib2 request? For example response = urllib2.urlopen('http://www.google.com').read().strip() provides data but I do not know if the return code was 200 or different. Thanks -- http://mail.python.org/mailman/lis