0
我想設計一個JSON對象,將與澤西島和傑克遜工作。JSON設計與查詢澤西島
對JSON/Restful編程來說,這是相當新的,所以我想知道下面是否可行。
{
"name": "myservice",
"orders": [
{
"name": "iphone",
"description": "iPhone 5",
"providers": [
{
"name": "a",
"description": "AT&T",
"pricing": ["$40", "$70", "$120"]
},
{
"name": "b",
"description": "Verizon",
"pricing": ["$45", "$60", "$85"]
}
]
},
{
"name": "galaxy3",
"description": "Samsung Galaxy 3",
"providers": [
{
"name": "a",
"description": "AT&T",
"pricing": ["$45", "$60", "$85"]
}
]
}
]
}
獲得有關iPhone的Verizon公司提供的所有信息:
curl GET -H'Content-Type: application/json' https://mydomain/myservice/iphone/b
將返回:對iPhone的定價
{
"name": "b",
"description": "Verizon",
"pricing": ["$45", "$60", "$85"]
}
獲取列表AT &牛逼提供商:
curl GET -H'Content-Type: application/json' https://mydomain/myservice/iphone/a?pricing
會返回:
{
["$40", "$70", "$120"]
}
任何示例或反饋將不勝感激!
您的問題是什麼?什麼不行? – 2012-11-08 21:32:19