MaatDeamon MaatDeamon - 1 year ago 238
JSON Question

Sending nested JSON object using HTTPie

I am trying to use HTTPie to parse to send some nested JSON object, but I can not find how. It is pretty clear how to send a JSON object but not a nested one such as

{ "user": { "name": "john"
"age": 10 } }

Answer Source

You can pass the whole JSON via stdin:

$ echo '{ "user": { "name": "john", "age": 10 } }' | http

Or specify the raw JSON as value with :=:

$ http user:='{"name": "john", "age": 10 }'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download