Skip to content

Commit 6495f00

Browse files
committed
Add office365 for _request method
1 parent 4c3cf09 commit 6495f00

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

microsoftgraph/client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,15 @@ def _patch(self, url, **kwargs):
481481
def _delete(self, url, **kwargs):
482482
return self._request('DELETE', url, **kwargs)
483483

484-
def _request(self, method, url, headers=None, **kwargs):
484+
def _request(self, method, url, headers=None, office365=False, **kwargs):
485485
_headers = {
486-
'Authorization': 'Bearer ' + self.token['access_token'],
487486
'Accept': 'application/json',
488487
'Content-Type': 'application/json'
489488
}
489+
if office365:
490+
_headers['Authorization'] = 'Bearer ' + self.office365_token['access_token']
491+
else:
492+
_headers['Authorization'] = 'Bearer ' + self.token['access_token']
490493
if headers:
491494
_headers.update(headers)
492495
return self._parse(requests.request(method, url, headers=_headers, **kwargs))

0 commit comments

Comments
 (0)