from urllib.parse import urlencode, quote, unquote # urlencode方法参数是字典 body = { "content": "悠悠", "charsetSelect": "utf-8", "en": "UrlEncode编码" } print(urlencode(body))
body = { "content": "悠悠", "charsetSelect": "utf-8", "en": "UrlEncode编码" } r = requests.post(url, params=par, data=body) print(r.url) print(unquote(r.url))