JSON数据格式

来源:互联网 发布:安知玉如意txt百度云 编辑:程序博客网 时间:2024/06/02 01:50

http://blog.csdn.net/xunyn/article/details/8283744


JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式。它基于JavaScript(Standard ECMA-262 3rd Edition - December 1999)的一个子集。 JSON采用完全独立于语言的文本格式,但是也使用了类似于C语言家族的习惯(包括C, C++, C#, Java, JavaScript, Perl, Python等)。这些特性使JSON成为理想的数据交换语言。易于人阅读和编写,同时也易于机器解析和生成。

五张图让你完全明白JSON的全部

In JSON, they take on these forms:

An object is an unordered set of name/value pairs. 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).

An array is an ordered collection of values. An array begins with [ (left bracket) and ends with ] (right bracket). Values are separated by , (comma).

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.

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.

number is very much like a C or Java number, except that the octal and hexadecimal formats are not used.


资料来源:http://www.json.org


JSON在线数据解析

http://json.parser.online.fr

更好用的JSON在线解析

http://jsonparser.com

左侧输入原始数据,右侧即可实时显示解析后的数据格式,很方便,其中{ }代表json数据对象,[ ]代表json数组。