本帖最后由 szwangbin001 于 2024-7-26 10:03 编辑
我有个http请求,我用apifox和reqable发送都是能正常发的,但是用python的request库去发送服务器返回的消息就异常了,实在找不到问题在哪,麻烦大佬帮忙看看
[Python] 纯文本查看 复制代码 import requests
url = "https://gateway.36dianping.com/api/qus/verifycode/web/mobile?sign=9d1c3fa450c67f8ee9a356330ba35c83"
payload = {
"param": {
"countryCode": "86",
"mobileNo": "ZLNNicobQe4RGnvwrxXbZB+Ilt9XoLeU9uvhS7XY3HblQD8jiM5iBztDsdmNoruc7jvD06SNKi7IJtMJ0kpdAu+KMCf+ylmQ2nYVfkyqGdVxwcR7RIrvoFa4IKwwxm7KumqhlhmRJLweRCNce0O6YgrtAAs8bmw/Q3o/KEHllcs=",
"verifyCodeType": 1
},
"partner_id": "dian-ping-web"
}
headers = {
'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36",
'Content-Type': "application/json"
}
response = requests.post(url,json=payload, headers=headers)
print(response.status_code)
print(response.text)
[Python] 纯文本查看 复制代码 PS C:\Users\vdesk\Desktop\123> & C:/Python/python.exe c:/Users/vdesk/Desktop/123/test2.py
200
{"msg":"签名错误,服务端待签名字符串:{\"param\": {\"countryCode\": \"86\", \"mobileNo\": \"ZLNNicobQe4RGnvwrxXbZB+Ilt9XoLeU9uvhS7XY3HblQD8jiM5iBztDsdmNoruc7jvD06SNKi7IJtMJ0kpdAu+KMCf+ylmQ2n
YVfkyqGdVxwcR7RIrvoFa4IKwwxm7KumqhlhmRJLweRCNce0O6YgrtAAs8bmw/Q3o/KEHllcs=\", \"verifyCodeType\": 1}, \"partner_id\": \"dian-ping-web\"}","code":1}
![](https://i.111666.best/image/TloI5msrr88TXVufMdswEM.png)
|