如何将 cURL 命令转换为 Python 请求

时间:2021-07-07 16:46:35

标签: python api curl https proxy

我一辈子都搞不清楚。

curl Command: curl --proxy-negotiate -u : <API_PATH> -H "Authorization: Bearer <token> " -H "Accept: application/scim+json"

此命令有效,但仅在我运行此命令后: set HTTPS_PROXY ,或 如果我通过在 Windows 设置中编辑环境变量来做到这一点。

在 Python 中,我这样做是等效的。

endpoint = <API_PATH>
headers = {"Authorization": B"earer <token> ", "Accept": "application/scim+json"

print(requests.get(endpoint, headers)```


I keep getting this proxy error: Caused by ProxyError('Cannot connect to proxy.', OSERROR('Tunnel connections failed: 407 Proxy Authentication required."


0 个答案:

没有答案
相关问题