【发布时间】:2021-09-02 22:27:11
【问题描述】:
我有一个需要登录的网站,然后允许搜索 api,它是公开的,它返回错误 405,我如何在 requests.post 中提供参数,因为以下代码不起作用
response = requests.post(
'https://www.somewebsite.com/api/public/',
auth=('asct1@gmail.com', 'Cons')
)
【问题讨论】:
-
如果您尝试登录,您不应该使用
requests.post方法吗? -
是的,实际上它只是 Post,它给出了 405 错误
标签: python api rest python-requests html-helper