当前位置:主页 > 软件编程 > Python代码 >

浅谈python requests 的put, post 请求参数的问题

时间:2021-12-21 10:09:42 | 栏目:Python代码 | 点击:

post, put请求的参数有两种形式

一种是把参数拼接在url中 对应postman

python requests 的put, post 请求参数

第二种是把参数放在body中 对应postman

python requests 的put, post 请求参数

在Python requests 库中

一般在的资料都会介绍 post,put请求的参数 用data 这种情况下参数会放在body中

但是有些接口参数通过body传入获取不到只能获取到URL中的参数 我们就需要用到 类似于get请求中的 params 传入参数

requests.post(url=url, params=data, verify=False, timeout=60)

用fiddler抓包查看 参数会直接在URL中

您可能感兴趣的文章:

相关文章