This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zathras
Recipients zathras
Date 2008-05-04.15:11:36
SpamBayes Score 0.03676231
Marked as misclassified No
Message-id <1209913898.38.0.175541514636.issue2756@psf.upfronthosting.co.za>
In-reply-to
Content
In urllib2 when using reusing a Request calling add_header doesn't work
when an unredirected_header has been added. 

A good example (and the one that caught me out) is content-type. When
making a POST request with no content-type set the current code sets the
content-type as an unredirected_header to
'application/x-www-form-urlencoded' (line 1034 of urllib2.py) but in a
subsequent request, setting the content type via add_header will see
this ignored as unredirected_headers are appended after the headers.

A possible solution is to check whether the header being added already
exists in the requests undredirected_headers and remove it if it does.
History
Date User Action Args
2008-05-04 15:11:38zathrassetspambayes_score: 0.0367623 -> 0.03676231
recipients: + zathras
2008-05-04 15:11:38zathrassetspambayes_score: 0.0367623 -> 0.0367623
messageid: <1209913898.38.0.175541514636.issue2756@psf.upfronthosting.co.za>
2008-05-04 15:11:37zathraslinkissue2756 messages
2008-05-04 15:11:36zathrascreate