Python - 处理 requets 请求接口时, 传输中文数据乱码问题
作者:互联网
# 使用 ensure_ascii=False
data = { 'name': '测试名称' } url = "https://api.weixin.qq.com/xxx/" data = json.dumps(data, ensure_ascii=False) headers = {'content-type': 'application/json;charset=utf-8'} response = requests.post(url, data=data.encode('utf-8'), headers=headers) res = json.loads(response.text)
标签:requets,utf,Python,ascii,乱码,headers,json,data,response 来源: https://www.cnblogs.com/chaoqi/p/16640459.html