We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9cabf87 commit 276b2e6Copy full SHA for 276b2e6
python_http_client/client.py
@@ -210,9 +210,9 @@ def http_request(*_, **kwargs):
210
else:
211
# Don't serialize to a JSON formatted str if
212
# we don't have a JSON Content-Type
213
- if 'Content-Type' in self.request_headers:
214
- if (self.request_headers['Content-Type']
215
- != 'application/json'):
+ content_type = self.request_headers.get('Content-Type')
+ if content_type is not None:
+ if content_type != 'application/json':
216
data = kwargs['request_body']
217
218
data = json.dumps(kwargs['request_body'])
0 commit comments