I use jq to pretty-print it.
jq is a lightweight and flexible command-line JSON processor.
jq is written in portable C, and it has zero runtime dependencies.
E.g.
Without JSON formatter
$ curl -s http://localhost:3000; echo
{"account":{"id":"HXRC","uri":["mailto:[email protected]","tel:366-643-7219"],"features":["585"],"nickname":"Consultant"}}
Install jq(Ubuntu):
$ sudo apt-get install jq
Use jq json formatter.
$ curl -s http://localhost:3000 | jq '.'
{
"account": {
"id": "HXRC",
"uri": [
"mailto:[email protected]",
"tel:366-643-7219"
],
"features": [
"585"
],
"nickname": "Consultant"
}
}
You can find more examples in tutorial. You can find the installation for each OS in download page
curl? You can't; it doesn't. There are plenty of tools you could pipe some JSON into and format it though. As such, I would suggest this is actually a software recommendation request.