Guest User

Untitled

a guest
Nov 6th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. from requests_ntlm import HttpNtlmAuth
  2. from pypac import PACSession, get_pac
  3.  
  4. session = PACSession(get_pac(url='mypac.pac'))
  5.  
  6. headers = {
  7. 'Content-Type': 'application/json;odata=verbose',
  8. 'Accept': 'application/json;odata=verbose',
  9. }
  10. username = 'username'
  11. password = 'password'
  12. url = "https://my.sharepoint.com/path/_api/contextinfo"
  13. request_result = session.get(url,
  14. auth=HttpNtlmAuth(username, password),
  15. headers=headers)
  16. print(request_result)
Add Comment
Please, Sign In to add comment