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

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

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



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



在Python requests 库中

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

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

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

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

猜你喜欢

转载自blog.csdn.net/wuchenlhy/article/details/79637876