JSON的格式
来源:互联网 发布:ubuntu搜索不到wifi 编辑:程序博客网 时间:2024/05/22 06:18
There are just a few rules that you need to remember:
•Objects are encapsulated within opening and closing brackets { }
•An empty object can be represented by { }
•Arrays are encapsulated within opening and closing square brackets [ ]
•An empty array can be represented by [ ]
•A member is represented by a key-value pair
•The key of a member should be contained in double quotes. (JavaScript does not require this. JavaScript and some parsers will tolerate single-quotes)
•Each member should have a unique key within an object structure
•The value of a member must be contained in double quotes if it's a string (JavaScript and some parsers will tolerates single-quotes)
•Boolean values are represented using the true or false literals in lower case
•Number values are represented using double-precision floating-point format. Scientific notation is supported
•Numbers should not have leading zeroes
•"Offensive"" characters in a string need to be escaped using the backslash character
•Null values are represented by the null literal in lower case
•Other object types, such as dates, are not properly supported and should be converted to strings. It becomes the responsability of the parser/client to manage this.
•Each member of an object or each array value must be followed by a comma if it's not the last one
•The common extension for json files is '.json'
•The mime type for json files is 'application/json'
例子:
{ "anObject": { "numericProperty": -122, "stringProperty": "An offensive \" is problematic", "nullProperty": null, "booleanProperty": true, "dateProperty": "2011-09-23" }, "arrayOfObjects": [ { "item": 1 }, { "item": 2 }, { "item": 3 } ], "arrayOfIntegers": [ 1, 2, 3, 4, 5 ]}
在线JSON转换及格式化网址: http://www.freeformatter.com/json-formatter.html
- JSON的基本格式
- JSON的结果格式
- JSON 格式的数据
- JSON的格式
- JSON格式的数据
- 复杂的json格式
- JSON格式的创建
- json的格式
- JSON格式的判定
- JSON格式的解析
- json格式的数据处理
- JSON的格式
- 关于JSON的格式
- json格式的数据
- 标准的json格式
- xml格式的字符串到json格式
- JSON格式与XML格式的比较
- 字符串格式的xml转json格式
- curl 错误
- design support library SnackBar简单使用
- 如何解决 Java 安全问题?
- haproxy 详细配置
- java常用设计模式
- JSON的格式
- keil中定义变量的位置 error C141: syntax error near 'int'
- android scrollview 嵌套listview
- dwr的安装
- java 解决js直接提交统计数据到后台
- android logcat中显示当前类名函数名和行数信息
- 工具-根据对象内字段名称是否重复,从list中删除元素
- 使用 jprofiler 检测Tomcate 内存及cpu消耗
- EL表达式中获取list长度