diff options
author | Facundo Batista <facundobatista@gmail.com> | 2008-09-03 22:35:50 (GMT) |
---|---|---|
committer | Facundo Batista <facundobatista@gmail.com> | 2008-09-03 22:35:50 (GMT) |
commit | c585df94766702ac6d6f3f0d27ad5d07e5546164 (patch) | |
tree | fafe4eb0d5bc1d5e6935ab4baf0f203d833d7ccd /Doc/library/urlparse.rst | |
parent | 69acb43327be1ee4dd19c4df3dc67668ebaa2d66 (diff) | |
download | cpython-c585df94766702ac6d6f3f0d27ad5d07e5546164.zip cpython-c585df94766702ac6d6f3f0d27ad5d07e5546164.tar.gz cpython-c585df94766702ac6d6f3f0d27ad5d07e5546164.tar.bz2 |
Issue 600362: Relocated parse_qs() and parse_qsl(), from the cgi module
to the urlparse one. Added a PendingDeprecationWarning in the old
module, it will be deprecated in the future. Docs and tests updated.
Diffstat (limited to 'Doc/library/urlparse.rst')
-rw-r--r-- | Doc/library/urlparse.rst | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Doc/library/urlparse.rst b/Doc/library/urlparse.rst index 02984f6..e7ed0f1 100644 --- a/Doc/library/urlparse.rst +++ b/Doc/library/urlparse.rst @@ -101,6 +101,45 @@ The :mod:`urlparse` module defines the following functions: .. versionchanged:: 2.5 Added attributes to return value. +.. function:: parse_qs(qs[, keep_blank_values[, strict_parsing]]) + + Parse a query string given as a string argument (data of type + :mimetype:`application/x-www-form-urlencoded`). Data are returned as a + dictionary. The dictionary keys are the unique query variable names and the + values are lists of values for each name. + + The optional argument *keep_blank_values* is a flag indicating whether blank + values in URL encoded queries should be treated as blank strings. A true value + indicates that blanks should be retained as blank strings. The default false + value indicates that blank values are to be ignored and treated as if they were + not included. + + The optional argument *strict_parsing* is a flag indicating what to do with + parsing errors. If false (the default), errors are silently ignored. If true, + errors raise a :exc:`ValueError` exception. + + Use the :func:`urllib.urlencode` function to convert such dictionaries into + query strings. + + +.. function:: parse_qsl(qs[, keep_blank_values[, strict_parsing]]) + + Parse a query string given as a string argument (data of type + :mimetype:`application/x-www-form-urlencoded`). Data are returned as a list of + name, value pairs. + + The optional argument *keep_blank_values* is a flag indicating whether blank + values in URL encoded queries should be treated as blank strings. A true value + indicates that blanks should be retained as blank strings. The default false + value indicates that blank values are to be ignored and treated as if they were + not included. + + The optional argument *strict_parsing* is a flag indicating what to do with + parsing errors. If false (the default), errors are silently ignored. If true, + errors raise a :exc:`ValueError` exception. + + Use the :func:`urllib.urlencode` function to convert such lists of pairs into + query strings. .. function:: urlunparse(parts) |