Skip to content

Commit 276b2e6

Browse files
Refactor to fix code style
1 parent 9cabf87 commit 276b2e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python_http_client/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ def http_request(*_, **kwargs):
210210
else:
211211
# Don't serialize to a JSON formatted str if
212212
# 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'):
213+
content_type = self.request_headers.get('Content-Type')
214+
if content_type is not None:
215+
if content_type != 'application/json':
216216
data = kwargs['request_body']
217217
else:
218218
data = json.dumps(kwargs['request_body'])

0 commit comments

Comments
 (0)