[issue25570] urllib.request > Request.add_header("abcd", "efgh") fails with character ":" in first parameter string

Martin Panter report at bugs.python.org
Fri Nov 6 19:24:38 EST 2015


Martin Panter added the comment:

Ah, I think I see where you are coming from. I guess you aren’t intimately familiar with the HTTP protocol. There are various types of “headers” aka header fields, not only User-Agent, but Content-Type and others. When they suggest passing a User-Agent header, that actually means a call like

request.add_header("User-Agent", "custom text here")

using the exact string "User-Agent" as the field name (key).

If you can given a specific comment line to add to a specific example, that might be useful. Even if you aren’t 100% sure of the details :)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25570>
_______________________________________


More information about the Python-bugs-list mailing list