mirror of https://github.com/scrapy/scrapy.git
sort_keys while serializing to json
This commit is contained in:
parent
ecda69130e
commit
71ef321b68
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Reference in New Issue