python3模拟post/get

helei 2020-8-24 915 8/24

post

url = "" 
headers = {
'Accept':'application/json, text/plain, */*',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
'Connection': 'keep-alive',
'Content-Length': '174',
'Content-Type': 'application/json;charset=UTF-8',
'Cookie': '',
'Host': 'carmanage.cd-trans.com.cn',
'Origin': '',
'Referer': '',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36 Edg/84.0.522.61'
}
payload = {
"pubRequest":{
"token":"","version":"1.0.0"
},"body":{
"pageNum":1,"pageSize":9999,"bizNo":"carCharter","lineName":"","state":"","contactPhone":"","productType":"","orderNo":""
}
}
# verify = False 忽略SSH 验证
r = requests.post(url, json=payload, headers=headers,verify=False)
return r.json()

get

url = ''
res = requests.get(url)
token = res.json()

- THE END -

helei

8月30日21:19

最后修改:2020年8月30日
0

非特殊说明,本博所有文章均为博主原创。