When a curl or other application returns a minified JSON, beautifying it makes it a lot more easy to read.
curl <url> | jq '.'
Example:
> curl -s http://dummy.restapiexample.com/api/v1/employees
{"status":"success","data":[{"id":"1","employee_name":"Tiger Nixon","employee_salary":"320800","employee_age":"61","profile_image":""},{"id":"2","employee_name":"Garrett Winters","employee_salary":"170750","employee_age":"63","profile_image":""},....
> curl -s http://dummy.restapiexample.com/api/v1/employees | jq '.'
{
"status": "success",
"data": [
{
"id": "1",
"employee_name": "Tiger Nixon",
"employee_salary": "320800",
"employee_age": "61",
"profile_image": ""
},
{
"id": "2",
"employee_name": "Garrett Winters",
"employee_salary": "170750",
"employee_age": "63",
"profile_image": ""
},...
With large unknown datasets, it might be interesting to only see the first few 'levels' of the response The amount of []? determains how many levels wil be shown
curl <url> | jq 'del(.[]?[]?[]?[]?)'
Example:
> curl -s http://dummy.restapiexample.com/api/v1/employees | jq 'del(.[]?[]?)'
{
"status": "success",
"data": []
}