import requests
url = "https://xxxxxx.sharepoint.com/sites/QE/Shared%20Documents/_api/GetFolderByServerRelativeUrl('product-xxxxx-metrics/xxxxx-dashboard-automation')/Files/add(url='test.csv',overwrite=true)"
payload=""
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjJaUXBKM1VwYmpBWVhZR2FYRUpsOGxWMFRPSSIsImtpZCI6IjJaUXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxHhZTkdqUhY0TKfWD6PsoOo2SM8Q',
'Accept': 'application/json;odata=verbose',
'Content-Type': 'application/json;odata=verbose',
'Host': 'axtria.sharepoint.com'
}
response = requests.request("POST", url, headers=headers, data= payload)
print(response.text)
Hi, I am using this code snippet to upload files on sharepoint using Python and this I have done using Postman Tool. I am getting no error but the file is also not getting uploaded on the specific location. Would really appreciate if anybody could help.