Skip to content

Commit 8e76579

Browse files
author
Kurt De Vos
committed
Fix KeyError 'content-type'
Some responses (like delete calendar event) don't include a Content-Type header.
1 parent fa1530b commit 8e76579

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

microsoftgraph/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ def _request(self, method, url, headers=None, **kwargs):
613613

614614
def _parse(self, response):
615615
status_code = response.status_code
616-
if 'application/json' in response.headers['Content-Type']:
616+
if 'application/json' in response.headers.get('Content-Type', ''):
617617
r = response.json()
618618
else:
619619
r = response.content

0 commit comments

Comments
 (0)