A problem with piping curl output through "python -mjson.tool" is that you can't include the response headers, which is sometimes useful.
(This was enough of a problem for me that I wrote a simple curl replacement in Python so I could have pretty-printed JSON or XML and response headers, or send the response directly to a Python REPL console as an object: https://github.com/cobralibre/hotpotato )
httpie is a nice replacement for curl which, among other things, has built-in formatting so you can get pretty JSON / XML responses without giving up your ability to do things like displaying response headers:
10 comments
[ 3.6 ms ] story [ 39.0 ms ] threadhttps://github.com/exhuma/braindump/tree/master/jsonformat
Really recommend setting up his dotfiles. After you back up your dotfiles, you can install his (which overwrites yours) just by writing
gem install jazor coderay
curl $SOMETHING | jazor | coderay -json
(This was enough of a problem for me that I wrote a simple curl replacement in Python so I could have pretty-printed JSON or XML and response headers, or send the response directly to a Python REPL console as an object: https://github.com/cobralibre/hotpotato )
alias jsonpp='ruby -r json -e '\''puts JSON.pretty_generate(JSON.parse(STDIN.read))'\'''
alias md5pass='dd if=/dev/random bs=100 count=1 2>/dev/null | md5'
https://github.com/jkbr/httpie