... 11.3 Debugging HTTP >>> import httplib >>> httplib.HTTPConnection.debuglevel = 1 >>> import urllib >>> feeddata = urllib.urlopen( 'http: //diveintomark.org/xml/atom.xml').read() connect: (diveintomark.org, ... 'OpenAnything/1.0 +http: //diveintopython.org /http_ web_ services/ ' class SmartRedirectHandler(urllib2.HTTPRedirectHandler): def http_ error_301(self, req, fp, code, msg, headers): result = urllib2.HTTPRedirectHandler .http_ error_301( ... urllib and dive into urllib2 Example 11.4 Introducing urllib2 >>> import httplib >>> httplib.HTTPConnection.debuglevel = 1 >>> import urllib2 >>> request = urllib2.Request( 'http: //diveintomark.org/xml/atom.xml')...