After using cgi.parse_qs()
, how to convert the result (dictionary) back to query string? Looking for something similar to urllib.urlencode()
.
urllib.parse.urlencode(query, doseq=False, [...])
Convert a mapping object or a sequence of two-element tuples, which may contain str or bytes objects, to a percent-encoded ASCII text string.
A dict
is a mapping.
urllib.urlencode
(query
[,doseq
])
Convert a mapping object or a sequence of two-element tuples to a “percent-encoded” string... a series ofkey=value
pairs separated by'&'
characters...