I am trying to make an HTTP request in Python 2.6.4, using the urllib module. Is there any way to set the request headers?
I am sure that this is possible using urllib2, but I would prefer to use urllib since it seems simpler.
There isn't any way to do that, which is precisely the reason urllib is deprecated in favour of urllib2.  So just use urllib2 rather than writing new code to a deprecated interface.
Any way to set request headers when doing a request using urllib in Python 2.x?