A JSON message consists of name-value pairs (objects), and ordered collections of values (arrays). Objects, arrays, or both structures can be nested.
For more detailed information about JSON, see the JavaScript Object Notation (JSON) web
site.
In a JSON message, an object is an unordered set of comma-separated name-value pairs that begins with a left brace ({) and ends with a right brace (}). Each name is followed by a colon (:).
JSON object .-,--------------------. V | >>---{--------string--:--value---+----}------------------------><
A JSON array is an ordered collection of comma-separated values that begins with left bracket ([) and ends with right bracket (]).
JSON array .-,---------. V | >>---[--------value---+----]-----------------------------------><
JSON value >>-+-string-+-------------------------------------------------->< +-number-+ +-object-+ +-array--+ +-true---+ +-false--+ '-null---'
A JSON string is very much like a C or Java™ string. A string is a collection of zero or more Unicode characters, wrapped in double quotation marks, using backslash escapes. A character is represented as a single character string.
JSON string >>---"----------------------------------------------------------> >--+------------------------------------------------------------+--> +-Any UNICODE character except " or \ or a control character-+ '-+------------------------------+---------------------------' +-\----------------------------+ '-+-" (quotation mark)-------+-' +-\\ (backslash)-----------+ +-/ (forward slash)--------+ +-b (backspace)------------+ +-f (formfeed)-------------+ +-n (newline)--------------+ +-r (carriage return)------+ +-t (horizontal tab)-------+ '-u (4 hexadecimal digits)-' >----"---------------------------------------------------------><
A JSON number is the same as a C or Java number, except that the octal and hexadecimal formats are not used.
JSON number .---------------. V | >>-+---+----+-0---------+-+--+-------------------+--------------> '-−-' '-digit 1-9-' +-−-----------------+ | .---------------. | | V | | '-----digit 0-9---+-' >--+-------------------+--------------------------------------->< +-e-----------------+ +-E-----------------+ +-+-+-+-------------+ | '-−-' | | .---------------. | | V | | '-----digit 0-9---+-'
Whitespace can be inserted between any pair of tokens.