Im trying to connect to a SharePoint list without using any pre-built modules. The reason I can't use modules like Shareplum/Sharepy is mainly due to security reasons, in order to use modules I need to get them approved.
I have identified the URL in order to get the XML code I need, if I put the URL in my webbrowser I get the correct text. The URL looks like this:
https://sharepoint site.com/sites/name/_api/lists/getbytitle('List name')/items
When I'm trying to reach this URL with the following Python code
import requests
from requests_ntlm import HttpNtlmAuth
r = requests.get(url, auth=HttpNtlmAuth(USERNAME, PASSWORD)
I get
"Access denied. You do not have permission to perform this action or access this resource"
Correct me if I'm wrong, but if I did my research correct this message is due to that SharePoint don't use HttpNtlmAuth, instead something called FedAuth-Cookie, which you can request from:
https://sharepoint site.com/_forms/default.aspx?wa=wsignin1.0
Could someone explain how I request and save this "FedAuth"-Cookie or point me in the right direction?