News for hackers. Stuff that matters.
Re:Easy CLI JSON Formatting by cobralibre on Friday November 09, 2012 @09:26AM (#4762897)
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 )

Re:Easy CLI JSON Formatting by js2 on Friday November 09, 2012 @10:01AM (#4763044)
Emit the headers to stderr?

  curl -v -s "$url" | python -mjson.tool
  curl -D /dev/stderr -s "$url" | python -mjson.tool