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.

It's usually a good idea to strip extraneous characters ...

Get Learn Qt 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.