# 使用 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)
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/python/283144.html