Skip to content

Commit 943116c

Browse files
author
root
committed
2 parents 908f2df + d4c38a9 commit 943116c

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

microsoftgraph/client.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -550,20 +550,18 @@ def _patch(self, url, **kwargs):
550550
def _delete(self, url, **kwargs):
551551
return self._request('DELETE', url, **kwargs)
552552

553-
def _request(self, method, url, headers=None, **kwargs):
554-
# print("URL EN REQUEST")
555-
# print(url)
553+
def _request(self, method, url, headers=None, office365=False, **kwargs):
556554
_headers = {
557-
'Authorization': 'Bearer ' + self.token['access_token'],
558555
'Accept': 'application/json',
559556
'Content-Type': 'application/json'
560557
}
558+
if office365:
559+
_headers['Authorization'] = 'Bearer ' + self.office365_token['access_token']
560+
else:
561+
_headers['Authorization'] = 'Bearer ' + self.token['access_token']
561562
if headers:
562563
_headers.update(headers)
563-
variable = requests.request(method, url, headers=_headers, **kwargs)
564-
# print(variable.url)
565-
# print(variable.request.headers)
566-
return self._parse(variable)
564+
return self._parse(requests.request(method, url, headers=_headers, **kwargs))
567565

568566
def _parse(self, response):
569567
status_code = response.status_code

0 commit comments

Comments
 (0)