The Python code is:
user = "aabc"
password = "yyy12%"
data = urllib.urlencode({"loginname": user, "nloginpwd": password})
print data
The result is: loginname=aabc&nloginpwd=yyy12%25
Why was 25 added to the end of the string?
The Python code is:
user = "aabc"
password = "yyy12%"
data = urllib.urlencode({"loginname": user, "nloginpwd": password})
print data
The result is: loginname=aabc&nloginpwd=yyy12%25
Why was 25 added to the end of the string?
On
From Wikipedia:
Because the percent ("%") character serves as the indicator for percent-encoded octets, it must be percent-encoded as "%25" for that octet to be used as data within a URI.
Simple example:
>>> urllib.parse.quote('%')
'%25'
The
%character has special meaning in a URL; it is used to start an escape sequence. See the Percent-encoding article on Wikipedia. A literal%then has to be encoded too, and%25is the encoded version. From the Wikipedia page:In other words, the
%25is an encoded%character.