IDigBio API v1 Examples: Difference between revisions

add curl man page entries
mNo edit summary
(add curl man page entries)
Line 20: Line 20:
[[File:JSONView_browser_extension_example.png|border|JSONView extension allows easier viewing in a web browser]]
[[File:JSONView_browser_extension_example.png|border|JSONView extension allows easier viewing in a web browser]]


If using a command-line tool (such as <code>curl</code>), you may wish to format the output of the JSON document using a "pretty printing" feature of some kind. This will make it more readable by humans and also allow it to be more easily filtered using tools such as <code>grep</code>.
If using a command-line tool (such as <code>curl</code>), you may wish to format the output of the JSON document using a "pretty printing" feature of some kind. This will make it more readable by humans and also allow it to be more easily filtered using tools such as <code>grep</code>. Here are some of the more commonly used curl options (from the curl man page):
 
<pre>
$ man curl
...
      -s, --silent
      -i, --include
      -v, --verbose
      -d, --data <data>
      -G, --get
...
</pre>


Two common tools available on Unix/Linux are python's json.tool or the json_pp command-line Perl script (JSON::PP). These tools can receive input from a pipe in the normal Unix fashion to chain multiple commands together.
Two common tools available on Unix/Linux are python's json.tool or the json_pp command-line Perl script (JSON::PP). These tools can receive input from a pipe in the normal Unix fashion to chain multiple commands together.
1,554

edits