import requests
import os
import sys
from requests.auth import HTTPBasicAuth
from requests_ntlm import HttpNtlmAuth
filename = 'test.xlsx' session = requests.Session() session.auth =
HttpNtlmAuth('/user:bentley.com\\EG','EG', session)
file = open(filename, 'rb') bytes = bytearray(file.read()) resp =
requests.put('https://EG.sharepoint.com/sites/EGPlatform/Eg/Testing%20Reports'
+ filename, data=bytes)
print(resp.status_code)