Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
98bc31f5
Commit
98bc31f5
authored
Jun 02, 2010
by
Senthil Kumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue8788 - description of doseq parameter in urllib.urlencode
parent
824912eb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
Doc/library/urllib.rst
Doc/library/urllib.rst
+13
-11
No files found.
Doc/library/urllib.rst
View file @
98bc31f5
...
@@ -236,17 +236,19 @@ Utility functions
...
@@ -236,17 +236,19 @@ Utility functions
.. function:: urlencode(query[, doseq])
.. function:: urlencode(query[, doseq])
Convert a mapping object or a sequence of two-element tuples to a "url-encoded"
Convert a mapping object or a sequence of two-element tuples to a
string, suitable to pass to :func:`urlopen` above as the optional *data*
"url-encoded" string, suitable to pass to :func:`urlopen` above as the
argument. This is useful to pass a dictionary of form fields to a ``POST``
optional *data* argument. This is useful to pass a dictionary of form
request. The resulting string is a series of ``key=value`` pairs separated by
fields to a ``POST`` request. The resulting string is a series of
``'&'`` characters, where both *key* and *value* are quoted using
``key=value`` pairs separated by ``'&'`` characters, where both *key* and
:func:`quote_plus` above. If the optional parameter *doseq* is present and
*value* are quoted using :func:`quote_plus` above. When a sequence of
evaluates to true, individual ``key=value`` pairs are generated for each element
two-element tuples is used as the *query* argument, the first element of
of the sequence. When a sequence of two-element tuples is used as the *query*
each tuple is a key and the second is a value. The value element in itself
argument, the first element of each tuple is a key and the second is a value.
can be a sequence and in that case, if the optional parameter *doseq* is
The order of parameters in the encoded string will match the order of parameter
evaluates to *True*, individual ``key=value`` pairs separated by ``'&'``are
tuples in the sequence. The :mod:`urlparse` module provides the functions
generated for each element of the value sequence for the key. The order of
parameters in the encoded string will match the order of parameter tuples in
the sequence. The :mod:`urlparse` module provides the functions
:func:`parse_qs` and :func:`parse_qsl` which are used to parse query strings
:func:`parse_qs` and :func:`parse_qsl` which are used to parse query strings
into Python data structures.
into Python data structures.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment