Martin Panter added the comment:

Rui: See Issue 12455 about changing the letter case of field names sent to the 
server. Unless someone wants to write a patch to fix all the bugs at once, I 
suggest to keep this thread focussed on Request.has_header() etc.

I closed Issue 5550 as a duplicate of this one. There is a patch there from 
2014 which does the same sort of thing as John’s issue2775.patch from 2008, but 
IMO John’s patch would be more efficient. It needs updating for Python 3.6 
though.

The remove_header() method (added in 3.4) should also be adjusted to be 
case-insensitive.

It may also be worth clarifying in the header_items() documentation that the 
keys have been converted as if by str.capitalize().

FTR: John’s issue2775.patch seems to be Patch Set 1 in the code review, despite 
being third in the list above.

----------
nosy: +martin.panter
stage: patch review -> needs patch
title: urllib/httplib header capitalization -> Make 
urllib.request.Request.has_header() etc case-insensitive
type: behavior -> enhancement

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue2275>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to