The previous section returned data in plain text. This is unusual in a web service and rarely satisfactory. Usually, web services return data in JSON, XML, or another structured format. The json_db project is identical to the memory_db project, except for its returning data in the JSON format.
First of all, let's see what happens when the same curl commands from the previous section are executed on it, as follows:
- The insertions have the same behavior because they just printed a number.
- The first query should print the following: [1,2,3]. The three numbers are in an array, and so they are enclosed in brackets.
- The second query should print the following: "Mary Jane". The name is a string, and so it is enclosed in quotation marks.
- The third query should print the following: [[2,"Jonathan"],[3,"Mary Jane"]]. The sequence of persons is an array of two records, and each of them is an array of two values, which are a number and a string...