You misread the documentation. You need to do two things:
- Quote each key and value from your dictionary, and
- Encode those into a URL
Luckily urllib.parse.urlencode
does both those things in a single step, and that's the function you should be using.
from urllib.parse import urlencode, quote_plus
payload = {'username':'administrator', 'password':'xyz'}
result = urlencode(payload, quote_via=quote_plus)
# 'password=xyz&username=administrator'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…