postman post请求 成功,python requests post请求 失败

原来代码

r2=requests.post(url=url,data=params,headers=headers, verify=False, timeout=15)
    return r2

data参数改成json就可以了:

r2=requests.post(url=url,json=params,headers=headers, verify=False, timeout=15)
    return r2

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐