Debugging Python HTTPConection recipe
Nice built in way to debug http connections problems in your python code.
This is nothing new, just for my reference, so I don’t have to hunt it down every time I need it.
import httplib
import urllib2
# For urllib it's enough to do
# httplib.HTTPConnection.debuglevel = 1
#
# but for urllib2 we have to:
handler = urllib2.HTTPHandler(debuglevel=1)
opener = urllib2.build_opener(handler)
urllib2.install_opener(opener)
Sources: python docs, Jamie Grove, python mailing list
