Skip to content

Commit

Permalink
Merge pull request googleapis#233 from cccmir/fix-empty-data-in-post-…
Browse files Browse the repository at this point in the history
…requests

fixed empty post data error
  • Loading branch information
Alejandro Casanovas authored Apr 22, 2019
2 parents c2d5d70 + f90f1ad commit 3dba572
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion O365/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def _internal_request(self, request_obj, url, method, **kwargs):
if kwargs.get('headers') is not None and kwargs['headers'].get(
'Content-type') is None:
kwargs['headers']['Content-type'] = 'application/json'
if 'data' in kwargs and kwargs['headers'].get(
if 'data' in kwargs and kwargs['data'] is not None and kwargs['headers'].get(
'Content-type') == 'application/json':
kwargs['data'] = json.dumps(
kwargs['data']) # auto convert to json
Expand Down

0 comments on commit 3dba572

Please sign in to comment.