网络编程
位置:首页>> 网络编程>> Python编程>> 浅谈python requests 的put, post 请求参数的问题

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

作者:吕海洋  发布时间:2023-05-06 14:54:47 

标签:python,requests,put,post

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中

来源:https://blog.csdn.net/wuchenlhy/article/details/79637876

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com