JSON简介
- JSON是一种轻量级的数据交换格式,采用完全独立于编程语言的文本格式来存储和表示数据。本质上就是一个"特殊格式"的字符串。
- JSON 是网络上用来传输数据使用最广泛的数据格式没有之一,且JSON比XML更轻量级
JSON的数据结构
- {对象}:保存对象(JSONObject)
- [数组]: 保存数组(JSONArray)
- 提示 : JSON描述对象的语法格式很像字典,但是不是字典,仅仅是键值对的形式很像。
json示例:
{
"code":200,
"data":{
"cars":[
{
"maxCapOfLuggage":5,
"capOfLuggage":2,
"capOfPerson":4,
"carDesc":"经济5座",
"carIntroduction":"",
"carPictures":[
"http://basedata.bj.bcebos.com/cartype/100005.png"
],
"carType":1,
"carTypeId":100005,
"currency":"RMB",
"currencyRate":1,
"priceId":"bd1434bb-f0c3-4b2b-b30a-785149b58f4a",
"price":199,
"priceLabel":"199.00",
"basePrice":199,
"priceSign":"a32c5cee4652db098d190c1646eadc94",
"models":"服务车型:xB或同级别车型",
"priceDeadTime":"2019-07-03 15:53:16",
"quoteList":[
"Quote1",
"Quote2",
"Quote3"
],
"seatType":5,
"serviceTags":[
"中文司导"
],
"urgentFlag":0,
"expenseDetail":null
},
{
"maxCapOfLuggage":8,
"capOfLuggage":3,
"capOfPerson":6,
"carDesc":"经济7座",
"carIntroduction":"",
"carPictures":[
"http://basedata.bj.bcebos.com/cartype/100007.png"
],
"carType":1,
"carTypeId":100007,
"currency":"RMB",
"currencyRate":1,
"priceId":"1bafa544-6af9-4c42-af60-4a976e2575f1",
"price":246,
"priceLabel":"246.00",
"basePrice":246,
"priceSign":"675f81a66d2f0199cb55962e79daa405",
"models":"服务车型:格锐Maxcruz或同级别车型",
"priceDeadTime":"2019-07-03 15:53:16",
"quoteList":[
"Quote1",
"Quote2",
"Quote3"
],
"seatType":7,
"serviceTags":[
"中文司导"
],
"urgentFlag":0,
"expenseDetail":null
},
{
"maxCapOfLuggage":5,
"capOfLuggage":2,
"capOfPerson":4,
"carDesc":"舒适5座",
"carIntroduction":"",
"carPictures":[
"http://basedata.bj.bcebos.com/cartype/200005.png"
],
"carType":2,
"carTypeId":200005,
"currency":"RMB",
"currencyRate":1,
"priceId":"17eefa46-e3fe-45d3-be74-3948b4627f6e",
"price":230,
"priceLabel":"230.00",
"basePrice":230,
"priceSign":"28be1fedbc722b5e3ae598e2334748ce",
"models":"服务车型:LS400或同级别车型",
"priceDeadTime":"2019-07-03 15:53:16",
"quoteList":[
"Quote1",
"Quote2",
"Quote3"
],
"seatType":5,
"serviceTags":[
"中文司导"
],
"urgentFlag":0,
"expenseDetail":null
},
{
"maxCapOfLuggage":8,
"capOfLuggage":3,
"capOfPerson":6,
"carDesc":"舒适7座",
"carIntroduction":"",
"carPictures":[
"http://basedata.bj.bcebos.com/cartype/200007.png"
],
"carType":2,
"carTypeId":200007,
"currency":"RMB",
"currencyRate":1,
"priceId":"903994cb-f3b0-4acc-978e-ed85786af622",
"price":261,
"priceLabel":"261.00",
"basePrice":261,
"priceSign":"57443a58f36c6633a8d809de0096652f",
"models":"服务车型:Express或同级别车型",
"priceDeadTime":"2019-07-03 15:53:16",
"quoteList":[
"Quote1",
"Quote2",
"Quote3"
],
"seatType":7,
"serviceTags":[
"中文司导"
],
"urgentFlag":0,
"expenseDetail":null
},
{
"maxCapOfLuggage":12,
"capOfLuggage":5,
"capOfPerson":8,
"carDesc":"舒适9座",
"carIntroduction":"",
"carPictures":[
"http://basedata.bj.bcebos.com/cartype/200009.png"
],
"carType":2,
"carTypeId":200009,
"currency":"RMB",
"currencyRate":1,
"priceId":"4a86aefd-4cbf-4088-afb2-ac5a605011d0",
"price":431,
"priceLabel":"431.00",
"basePrice":431,
"priceSign":"b1c60f5e19378dfa067d77ba8783230a",
"models":"服务车型:海狮(Hiace)或同级别车型",
"priceDeadTime":"2019-07-03 15:53:16",
"quoteList":[
"Quote1",
"Quote2",
"Quote3"
],
"seatType":9,
"serviceTags":[
"中文司导"
],
"urgentFlag":0,
"expenseDetail":null
},
{
"maxCapOf