A summary of some of the JSON essentials

Source: Internet
Author: User

JavaScript Object Notation

CSRF (pronounced Sea-surf)

Literal (literal): The meaning of a string is consistent with the meaning to be expressed

JSON is a data interchange format (hence no directives). Schema can be used to verify consistency (which can have those attributes, as well as the value range wait)
Data types for JSON:
(1) object: Must start with "{" and End with "}"
(2) Array: Only the same data type and null can be saved. Must start with "[", "]" to end
(3) String: Must be wrapped with double quotes
(4) Number: Do not use double quotation marks to wrap
(5) Boolean: Do not use double quotation marks to wrap. The optional value is only true,false. Case-sensitive, other notation is not Boolean, is a normal string
(6) NULL: Double quotation marks are not required for wrapping. can only be null. Case-sensitive, other notation is not NULL, just a normal string

In a key-value pair, the key must be wrapped in double quotation marks. Single quotes cannot be used (single quotes can be used in JavaScript objects, not in JSON).

If you use double quotation marks in a key or value, you must use the escape character \. The key that contains the double quotation marks: "Hello \" World \ "."

Syntax constraints:
(1) JSON must start with "{" and End with "}"
(2) The array must start with "[" and "]" to end
(3) Each element in the array, each property in the object, must be separated by ","
(4) Key--value must be separated by ":"

Top-level arrays in JSON:

[

1,

2

]

A summary of some of the JSON essentials

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.