Go | What is json ?

JSON (JavaScript Object Notation) is a lightweight data-interchange format.

JSON was first presented to the world at the JSON.org website in 2001. A definition of the JSON syntax was subsequently published as IETF RFC 4627 in July 2006. ECMA-262, Fifth Edition (2009) included a normative specification of the JSON grammar. This specification, ECMA-404, replaces those earlier definitions of the JSON syntax. Concurrently, the IETF published RFC 7158/7159 and in 2017 RFC 8259 as updates to RFC 4627. The JSON syntax specified by this specification and by RFC 8259 are intended to be identical.

Advantages
  1. It is easy for humans to read and write.
  2. It is easy for machines to parse and generate.
  3. It is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others.

JSON does not support cyclic graphs, at least not directly. JSON is not indicated for applications requiring binary data.

Two Structures
  1. A collection of name/value pairs.
  2. An ordered list of values.
Forms

1、An object begins with {left brace and ends with }right brace . Each name is followed by :colon and the name/value pairs are separated by ,comma.

在这里插入图片描述
2、An array is an ordered collection of values. An array begins with [left bracket and ends with ]right bracket. Values are separated by ,comma.

在这里插入图片描述

3、A value can be a string in double quotes, or a number, or true or false or null, or an object or an array. These structures can be nested.

在这里插入图片描述
4、A string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. A character is represented as a single character string. A string is very much like a C or Java string.

在这里插入图片描述
5、A number is very much like a C or Java number, except that the octal and hexadecimal formats are not used.
在这里插入图片描述

Whitespace can be inserted between any pair of tokens.

在这里插入图片描述

//References

[1] Standard ECMA-404 [The JSON Data Interchange Syntax ] 2nd Edition / December 2017(https://ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf)

[2] IETF RFC 8259 The JavaScript Object Notation (JSON) Data Interchange Format(https://www.rfc-editor.org/rfc/rfc8259.html)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值