Merge "Replace functions 'Dict.get' and 'del' with 'Dict.pop'"
This commit is contained in:
commit
dde6bc4d4f
|
@ -145,13 +145,10 @@ class HTTPClient(object):
|
|||
resp.text)
|
||||
|
||||
def serialize(self, kwargs):
|
||||
if kwargs.get('json') is not None:
|
||||
json_data = kwargs.pop('json', None)
|
||||
if json_data is not None:
|
||||
kwargs['headers']['Content-Type'] = 'application/json'
|
||||
kwargs['data'] = json.dumps(kwargs['json'])
|
||||
try:
|
||||
del kwargs['json']
|
||||
except KeyError:
|
||||
pass
|
||||
kwargs['data'] = json.dumps(json_data)
|
||||
|
||||
def get_timings(self):
|
||||
return self.times
|
||||
|
|
Loading…
Reference in New Issue