Python has an awesome urlencode () function that encodes dictthrough RFC 1738 (plus encoding):
>>> urllib.parse.urlencode({'site':'Stack Overflow','Coder':'Jeff Atwood'})
'Coder=Jeff+Atwood&site=Stack+Overflow'
I can’t find a replacement that uses RFC 3986 (Percent Encoding), although the thin guide states the following :
RFC 3986 - Uniform Resource Identifiers
This is the current standard (STD66). Any changes to the urllib.parse module should be consistent with this.
This will be the expected result:
>>> urllib.parse.urlencode({'site':'Stack Overflow','Coder':'Jeff Atwood'})
'Coder=Jeff%20Atwood&site=Stack%20Overflow'
Of course, I could collapse myself, but I find it amazing that I cannot find such a built-in Python function. Is there such a Python function that I just can't find?