由python2改写成python3 :import requests url = "https://crm.baidu.com/polaris-web/sme-cust/verify/verifyName" payload = "{\"name\":\"三本树(上海)教育科技有限公司\"}" headers = { 'isajax': 'true', 'Cookie': 'BIDUPSID=A09C98D9802D21EDCE9B8A4490EC5CE2; PSTM=1684252632; BAIDUID=A09C98D9802D21ED17765F505D625969:FG; BAIDUID_BFESS=A09C98D9802D21ED17765F505D625969:FG; ZFY=qt8fKnqLflisaA:BUnKqV:Awo8rk7t:AVWJCPMo5050PfU:C; HR_SIGN=UC_70a2711cf0144243891424851662987554571; Hm_lpvt_2188c29772eeba07a9fce63dc27d321c=1685026331; RT="z; tk=313027c567ba2913015e3f047346a9b2-1685026351022', 'User-Agent': 'Apifox/1.0.0 (https://apifox.com)', 'Content-Type': 'application/json;charset=UTF-8' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
时间: 2024-02-09 10:07:13 浏览: 174
import requests
url = "https://crm.baidu.com/polaris-web/sme-cust/verify/verifyName"
payload = "{\"name\":\"三本树(上海)教育科技有限公司\"}"
headers = {
'isajax': 'true',
'Cookie': 'BIDUPSID=A09C98D9802D21EDCE9B8A4490EC5CE2; PSTM=1684252632; BAIDUID=A09C98D9802D21ED17765F505D625969:FG; BAIDUID_BFESS=A09C98D9802D21ED17765F505D625969:FG; ZFY=qt8fKnqLflisaA:BUnKqV:Awo8rk7t:AVWJCPMo5050PfU:C; HR_SIGN=UC_70a2711cf0144243891424851662987554571; Hm_lpvt_2188c29772eeba07a9fce63dc27d321c=1685026331; RT=\"z; tk=313027c567ba2913015e3f047346a9b2-1685026351022',
'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
'Content-Type': 'application/json;charset=UTF-8'
}
response = requests.post(url, headers=headers, data=payload.encode('utf-8'))
print(response.text)
阅读全文