Created
December 1, 2011 15:23
-
-
Save fideloper/1417527 to your computer and use it in GitHub Desktop.
Shell - append curl JSON request results in a nice format to an output file, with basic auth - mjson tool
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
#With Basic Auth | |
curl --user someuser:somepassword -d 'some_post=variables&go=here' http://api.somecoolapi.com/json.somedata | python -mjson.tool >> /path/of/file/to/export/to.txt | |
#Without Basic Auth | |
curl -d 'some_post=variables&go=here' http://api.somecoolapi.com/json.somedata | python -mjson.tool >> /path/of/file/to/export/to.txt | |
#More Goodies: http://www.davidslog.com/1187630823/format-xml-json-from-command-line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment