|
以下为黄鸟抓包水务公众号的请求原始头文件。其中请求体中的“requestPara”中的参数,如何传达到POST请求。请大佬指教。
POST /iwater/v1/watermeter/queryPayMentInfo/v2.json HTTP/1.1
Host: wt.ptswater.cn
Connection: keep-alive
Content-Length: 291
Accept: application/json, text/plain, */*
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 NetType/WIFI MicroMessenger/7.0.20.1781(0x6700143B) WindowsWechat(0x63090c0f) XWEB/11253 Flue
Content-Type: application/x-www-form-urlencoded
Origin: https://wt.ptswater.cn
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://wt.ptswater.cn/h5/
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
requestPara={"meterNumber":"100048853","startDate":"20240101","endDate":"20241231","payStatus":"2","token":"JbwSSaXtbJBlD0CFOCRoaFNa-7j-KRDl7uIv2H8dTSWR2ERk8B8X3y_f2KAn1_ubq8SZGwSoJ_SbbbNQMcsqaA","waterCorpId":3,"UNID":"","areaId":0,"accountType":"XJ","apiType":"JSAPI","appVersion":"1.0.2"}
以下我用FUCTION编写的请求头函数:
msg.headers = {
'Connection': 'keep-alive',
'Content-Length': '291',
'Accept': 'application/json, text/plain, */*',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 NetType/WIFI MicroMessenger/7.0.20.1781(0x6700143B) WindowsWechat(0x63090c0f) XWEB/11253 Flue',
'Content-Type': 'application/x-www-form-urlencoded',
'Origin: https':'//wt.ptswater.cn',
'Sec-Fetch-Site': 'same-origin',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Referer: https':'//wt.ptswater.cn/h5/',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'zh-CN,zh;q=0.9',
}
msg.payload= {
requestPara:{
"meterNumber":"100048853",
"startDate":"20240101",
"endDate":"20241231",
"payStatus":"2",
"token":"JbwSSaXtbJBlD0CFOCRoaFNa-7j-KRDl7uIv2H8dTSWR2ERk8B8X3y_f2KAn1_ubq8SZGwSoJ_SbbbNQMcsqaA",
"waterCorpId":3,
"UNID":"",
"areaId":0,
"accountType":"XJ",
"apiType":"JSAPI",
"appVersion":"1.0.2"
}
}
return msg;
请求时会出现
RequestError: Header name must be a valid HTTP token ["Origin: https"] : https://wt.ptswater.cn/iwater/v1 ... PayMentInfo/v2.json
|
|