bailiw 发表于 2020-5-20 15:52:28

python post 请求

本帖最后由 bailiw 于 2020-5-20 15:57 编辑

python post 请求时 Invalid argument supplied for foreach() in


import requests
import json

url = 'http://www.amingtool.com/getdata.php'


head = {
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,zh;q=0.9',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'Content-Length': '23',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Cookie': 'Hm_lvt_9e811481d4b93d78ef0e62012807f1f7=1589437448,1589505884,1589592774,1589946853; Hm_lpvt_9e811481d4b93d78ef0e62012807f1f7=1589946853; Hm_lvt_459734649f53a7fd3b34ae4709c35060=1589437448,1589505884,1589592774,1589946853; Hm_lpvt_459734649f53a7fd3b34ae4709c35060=1589946853',
'Host': 'www.amingtool.com',
'Origin': 'http://www.amingtool.com',
'Pragma': 'no-cache',
'Referer': 'http://www.amingtool.com/trans',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36',
'X-Requested-With': 'XMLHttpRequest'
}

payload = {'type': 'kqzs', 'val': }

r = requests.post(url, data=payload, headers=head,verify=False)



print(r.text)



转成json再请示也是不行的,怎么办

bailiw 发表于 2020-5-20 20:14:26

已经搞定了
页: [1]
查看完整版本: python post 请求