Skip to content

Instantly share code, notes, and snippets.

@bluearth
Last active December 22, 2020 16:11
Show Gist options
  • Save bluearth/2c51af0a90c187aa8049ddb773447a3d to your computer and use it in GitHub Desktop.
Save bluearth/2c51af0a90c187aa8049ddb773447a3d to your computer and use it in GitHub Desktop.
So you need to Invoke a HTTP API that returns JSON but you dont want to leave the comfort of your console. And you want the JSON response to be well formatted and color-highlighted

So you need to Invoke a HTTP API that returns JSON but you dont want to leave the comfort of your console. And you want the JSON response to be well formatted and color-highlighted.

You'll need:

  1. cURL
  2. json_pp
  3. pygmentize

You can just apt install all of them

Here's an example:

# curl -s -X GET http://127.0.0.1/api/people | json_pp | pygmentize -l json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment