summaryrefslogtreecommitdiffstats
path: root/Doc/library/urllib.parse.rst
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-03-16 01:11:16 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2012-03-16 01:11:16 (GMT)
commit6b3434ae04f32a20e20498ec5a594d527e1c24e3 (patch)
tree47bc983269e09238ee3fdca6377a8dd6b855bb30 /Doc/library/urllib.parse.rst
parent73277fe0ebd07b470e43804c24282a4947a63341 (diff)
downloadcpython-6b3434ae04f32a20e20498ec5a594d527e1c24e3.zip
cpython-6b3434ae04f32a20e20498ec5a594d527e1c24e3.tar.gz
cpython-6b3434ae04f32a20e20498ec5a594d527e1c24e3.tar.bz2
Explain the use of charset parameter with Content-Type header. Issue11082
Diffstat (limited to 'Doc/library/urllib.parse.rst')
-rw-r--r--Doc/library/urllib.parse.rst7
1 files changed, 4 insertions, 3 deletions
diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst
index aece714..b33e8fe 100644
--- a/Doc/library/urllib.parse.rst
+++ b/Doc/library/urllib.parse.rst
@@ -512,9 +512,10 @@ task isn't already covered by the URL parsing functions above.
Convert a mapping object or a sequence of two-element tuples, which may
either be a :class:`str` or a :class:`bytes`, to a "percent-encoded"
- string. The resultant string must be converted to bytes using the
- user-specified encoding before it is sent to :func:`urlopen` as the optional
- *data* argument.
+ string. If the resultant string is to be used as a *data* for POST
+ operation with :func:`urlopen` function, then it should be properly encoded
+ to bytes, otherwise it would result in a :exc:`TypeError`.
+
The resulting string is a series of ``key=value`` pairs separated by ``'&'``
characters, where both *key* and *value* are quoted using :func:`quote_plus`
above. When a sequence of two-element tuples is used as the *query*