mirror of
https://github.com/httpie/cli.git
synced 2025-06-24 03:21:26 +02:00
Merge pull request #337 from joaodelgado/json-serialization
Only serialize json if data is a dict instance
This commit is contained in:
commit
d8b819b03f
@ -92,7 +92,7 @@ def get_requests_kwargs(args, base_headers=None):
|
|||||||
# Serialize JSON data, if needed.
|
# Serialize JSON data, if needed.
|
||||||
data = args.data
|
data = args.data
|
||||||
auto_json = data and not args.form
|
auto_json = data and not args.form
|
||||||
if args.json or auto_json and isinstance(data, dict):
|
if (args.json or auto_json) and isinstance(data, dict):
|
||||||
if data:
|
if data:
|
||||||
data = json.dumps(data)
|
data = json.dumps(data)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user