urlencode编/解码

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))

上一篇:python之编码与解码


下一篇:URL编码