脚本之家,脚本语言编程技术及教程分享平台!
分类导航

Python|VBS|Ruby|Lua|perl|VBA|Golang|PowerShell|Erlang|autoit|Dos|bat|

服务器之家 - 脚本之家 - Python - 浅谈python requests 的put, post 请求参数的问题

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

2021-05-11 00:18吕海洋 Python

今天小编就为大家分享一篇浅谈python requests 的put, post 请求参数的问题,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧

postput请求的参数有两种形式

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

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

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

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

python requests 库中

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

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

?
1
requests.post(url=url, params=data, verify=false, timeout=60)

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

以上这篇浅谈python requests 的put, post 请求参数的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持服务器之家。

原文链接:https://blog.csdn.net/wuchenlhy/article/details/79637876

延伸 · 阅读

精彩推荐