Created
February 10, 2017 17:14
-
-
Save mterzo/c4affc2cd767ea6b3a075eb28544e128 to your computer and use it in GitHub Desktop.
Quick and dirty json pretty print
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prettyjson(){ | |
python -c 'import json, sys; print json.dumps(json.loads(\ | |
sys.stdin.read()), sort_keys=True, indent=2,\ | |
separators=(",", ": "))' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try just piping your json into
jq
Like:
curl -X POST -F "foo=bar" localhost:8080/api/v1/example | jq
A bigger example: