curl pretty print json

JavaScript
echo '{"foo": "lorem", "bar": "ipsum"}' | jq
curl ... | json_pp 

Source

Also in JavaScript: