V-Spark Online Help

Using cURL for REST API Testing

The JSON output that is produced by V‑Spark APIs is not easily readable by humans. When using cURL to make API calls, the output of the cURL command can be piped to Python in order to print that output in a more human-legible format, as in the following example:

cURL command | python -m json.tool

Tip

The json.tool module that is provided by Python sorts keys in JSON output alphabetically. If you want to reformat JSON output to make it more legible without reorganizing key values, consider using the Python command jsonlint. This command includes JSON reformatting along with JSON validation and other capabilities, and is provided as part of the python-demjson-2.2.2-1.el7.noarch package on CentOS 7 systems.