JSON
In case you have never come across JSON before, let’s have a quick crash course. It is a simple and lightweight way to express hierarchies of objects and their properties. It is a very popular choice when sending data in HTTP requests. It is similar to XML in intent but is much less verbose.
A JSON object is encapsulated in curly braces {}
, while properties are denoted in the format key: value. Strings are delimited with double quotes ""
. We can represent a single client object as follows:
{ "reference": "CLIENT0001", "name": "Dale Cooper" }
Note that white space and control characters such as tab and newline are ignored—the indented properties are to simply make things more readable.
Note
It's usually a good idea to strip extraneous characters out of JSON when transmitting over the network (for example, in an HTTP request) in order to reduce the size of the payload; every byte counts!
Property values can be one of the following types: String
, Number
, JSON Object
, JSON Array
, and...