0
我试过基本身份验证,但后面跟着this link。我也跟着this question使用NTLM身份验证来获取我的代码。我仍然被抛出401错误。这是拉扯SharePoint列表的过时方式还是我的代码有问题?尝试访问SharePoint列表时,Python抛出401错误
import requests
from requests_ntlm import HttpNtlmAuth
response = requests.get("https://example.com/_api/web/...", auth=HttpNtlmAuth('username', 'password'))
print(response.status_code)
它是以401状态响应的服务器。响应体是什么? 'print(response.text)' 你确定服务器使用ntlm吗?您是否能够使用卷曲或其他方式进行连接?您是否尝试过使用请求“accept”标头。 '{'accept':'application/json'}' –
我确定服务器使用ntlm,并且我们已经能够使用jquery进行连接。当我把response.text我没有输出。我将尝试添加接受标题 –