json
Ubuntu,  Uncategorized

Displaying json output in linux terminal

Many times when I’m testing an api, I like to go into chrome, copy the output to CURL, and use the terminal to see what that API will return.

To copy curl, just follow the following gif steps

In order not to have to type the input data repeatedly in chrome, we can play curl in the terminal, and run it concatenating in jq (install it here)

So when running curl in the terminal, include the jq at the end of the command, like this

To transform

into

Notice: ob_end_flush(): failed to send buffer of zlib output compression (0) in /home/samu/public_html/blog/wp-includes/functions.php on line 5275