sort_keys while serializing to json

This commit is contained in:
kasun Herath 2018-12-12 11:12:48 +05:30
parent ecda69130e
commit 71ef321b68
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ class JSONRequest(Request):
warnings.warn('Both body and data passed. data will be ignored')
elif not body_passed and data_passed:
kwargs['body'] = json.dumps(data)
kwargs['body'] = json.dumps(data, sort_keys=True)
if 'method' not in kwargs:
kwargs['method'] = 'POST'