JSON是一種簡(jiǎn)單數(shù)據(jù)格式萄唇,它有三種數(shù)據(jù)結(jié)構(gòu):
- 鍵值對(duì) —— Name/Value (Key/Value)
{ “firstName”: “John”} - 對(duì)象 —— Object
{ “address” : { “l(fā)ine1” : “555 Main Street”, “city” : “Denver”, “stateOrProvince” : “CO”, “zipOrPostalCode” : “80202”, “country” : “USA” }} - 數(shù)組 —— Arrays
{ “people” : [ { “firstName”: “John”, “l(fā)astName”: “Smith”, “age”: 35 }, { “firstName”: “Jane”, “l(fā)astName”: “Smith”, “age”: 32 } ]}
一個(gè)有效的JSON文檔需要被包含在一對(duì)花括號(hào)內(nèi)
{ JSON-Data }
JSON中的key必須是string類(lèi)型惩妇,數(shù)值(鍵值對(duì)中的值)可以是以下任意一種:Object、Array葬凳、String突琳、Number他巨、Boolean、null
- JSON Editor Online
- jsonlint