Viewing Query Response as JSON Data

The DDS backend supports sending data as either JSON or XML.

To view the data as XML, run the query in a curl command by adding the -H switch set like the following:

curl "http://<dds_host>:<dds_port>/dynamic-data-service-web/resources/dds/<selected_schema>/data?fromTables=<selected_table>&offset=0&pageLimit=25" -H "Accept:application/xml" -u <dds_user>:<dds_pass> -o file_name.txt

JSON is the default response format. To return a JSON object, do not include the -H switch in the cURL command.

Or, you can set the cURL command with the -H switch setting Accept to application/json in the header. The cURL with output is as follows:

Curl -i -H "Authorization: Bearer $AccessToken" -H "Content-Type: application/json;charset=UTF-8" --request GET  "http://<dds_host>:<dds_port>/dynamic-data-service-web/resources/dds/<selected_schema>/data?fromTables=<selected_table>&offset=0&pageLimit=25" -H "Accept:application/json" -o file_name.txt
Query Response Formatted as JSON Data

Note:

Ensure that the required DDS application username/password is supplied.