A JSON Object is surrounded by curly braces and contains key-value pairs.
{ "key1": "value1", "key2": "value2", ... }
Keys must be valid strings, thus surrounded by double quotation marks. Values can be JSON objects, numbers, strings, arrays, or one of the following 'literal names': false
, null
, or true
. In a key-value pair, the key is seperated from the value by a colon. Multiple key-value-pairs are separated by commas.
Order in objects is not important. The following JSON object is thus equivalent to the above:
{ "key2": "value2", "key1": "value1", ... }
To sum it all up, this is an example of a valid JSON Object :
{
"image": {
"width": 800,
"height": 600,
"title": "View from 15th Floor",
"thumbnail": {
"url": "http://www.example.com/image/481989943",
"height": 125,
"width": 100
},
"visible": true,
"ids": [116, 943, 234, 38793]
}
}