PyDocs

Nav

Internet Protocols and Support

urlencode

urllib.parse

function (source) Deprecated 3.14
  • urlencode(query, doseq=False, safe='', encoding=None, errors=None, quote_via=quote_plus)
Deprecated since 3.14. Accepting objects with false values (like 0 and []) except empty strings and byte-like objects and None is now deprecated.
Encode a dict or sequence of two-element tuples into a URL query string.

If any values in the query arg are sequences and doseq is true, each
sequence element is converted to a separate parameter.

If the query arg is a sequence of two-element tuples, the order of the
parameters in the output will match the order of parameters in the
input.

The components of a query arg may each be either a string or a bytes type.

The safe, encoding, and errors parameters are passed down to the function
specified by quote_via (encoding and errors only if a component is a str).
Changed in 3.2, 3.5
  • 3.2: query supports bytes and string objects.
  • 3.5: Added the quote_via parameter.
0 Examples
No examples for urllib.parse/urlencode.
See Also
No see-alsos for urllib.parse/urlencode
0 Notes
No notes for urlencode