Representing data with JSON
JSON is a simple data format which is designed for easy reading and writing for humans, while also being straightforward for machines to process and create. One small feature that a human user may miss is that JSON does not support comments.
It is based on a subset of the JavaScript programming language and is completely language-independent, with parsers available for every programming language.
A JSON document is built from two structures:
- A collection of name/value pairs: In various languages, this is implemented as an object, record, struct, dictionary, hash table, keyed list, or associative array
- An ordered list of values: In most languages, this is implemented as an array, vector, list, or sequence
Here is a simple example of a JSON document for a book
object:
{
"book": {
"title": "Mastering RESTful JSON Essentials",
"author": "Multiple Authors",
...