karl added the comment: The wireshark trace is a different domain than the code example. But let's see. cocobear added:
headers = [("Content-Type","application/oct-stream"),] with a "Content-Type", not the capitalized "Type". BUT in the source code or urllib/request.py there is http://hg.python.org/cpython/file/3.3/Lib/urllib/request.py#l1184 if not request.has_header('Content-type') And if you check has_header at http://hg.python.org/cpython/file/3.3/Lib/urllib/request.py#l367 it compares exactly the string it has received, when HTTP headers are case insensitive. It reminds me of http://bugs.python.org/issue12455 http://bugs.python.org/issue17322 with capitalization issues. I'm changing the title to be more exact. ---------- nosy: +karlcow title: urllib2 use of opener.addheaders -> [urllib.request]: Comparison of HTTP headers should be insensitive to the case _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5550> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com