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

Martin Panter report at bugs.python.org
Sun Nov 8 20:04:16 EST 2015


Martin Panter added the comment:

Hmm, I wonder if that OpenerDirector example is a bit obscure. Normally you would use the default urlopen() to set User-Agent, without resorting to a custom OpenerDirector.

In my patch:

* Included “User-Agent header _value_” in the “headers” parameter description
* Linked to <https://docs.python.org/dev/howto/urllib2.html> from examples section
* Added add_header("User-Agent", ...) example with made-up custom value

Let me know what you think (if anything is unnecessary, other suggestions?)

----------
assignee:  -> docs at python
components: +Documentation -Library (Lib)
keywords: +patch
nosy: +docs at python
stage: needs patch -> patch review
type: behavior -> enhancement
versions: +Python 2.7, Python 3.4, Python 3.6
Added file: http://bugs.python.org/file40984/add_header.patch

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


More information about the docs mailing list