Merge "Replace functions 'Dict.get' and 'del' with 'Dict.pop'"
This commit is contained in:
@@ -307,8 +307,7 @@ class HTTPClient(object):
|
|||||||
|
|
||||||
if 'body' in kwargs:
|
if 'body' in kwargs:
|
||||||
kwargs['headers']['Content-Type'] = 'application/json'
|
kwargs['headers']['Content-Type'] = 'application/json'
|
||||||
kwargs['data'] = json.dumps(kwargs['body'])
|
kwargs['data'] = json.dumps(kwargs.pop('body'))
|
||||||
del kwargs['body']
|
|
||||||
api_versions.update_headers(kwargs["headers"], self.api_version)
|
api_versions.update_headers(kwargs["headers"], self.api_version)
|
||||||
|
|
||||||
if self.timeout:
|
if self.timeout:
|
||||||
|
@@ -144,11 +144,7 @@ class HTTPClient(object):
|
|||||||
def serialize(self, kwargs):
|
def serialize(self, kwargs):
|
||||||
if kwargs.get('json') is not None:
|
if kwargs.get('json') is not None:
|
||||||
kwargs['headers']['Content-Type'] = 'application/json'
|
kwargs['headers']['Content-Type'] = 'application/json'
|
||||||
kwargs['data'] = json.dumps(kwargs['json'])
|
kwargs['data'] = json.dumps(kwargs.pop('json'))
|
||||||
try:
|
|
||||||
del kwargs['json']
|
|
||||||
except KeyError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def get_timings(self):
|
def get_timings(self):
|
||||||
return self.times
|
return self.times
|
||||||
|
Reference in New Issue
Block a user