urllib2: correct way how to add a header to the *initial* request?

2014-02-08 Thread Matěj Cepl
Hi, this is probably a dumb question but I just cannot find a way how to create AuthHandler which would add Authorization header to the FIRST request. The only thing I see in urllib2.py are various http_error handler which add Authorization header to the ADDITIONAL request which handles the er

urllib2: correct way how to add a header to the *initial* request?

2014-02-08 Thread Matěj Cepl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, this is probably a dumb question but I just cannot find a way how to create AuthHandler which would add Authorization header to the FIRST request. The only thing I see in urllib2.py are various http_error handler which add Authorization header