2
我正在使用RESTful API。我們的其中一個屏幕顯示總表。使用REST發送列表/表格數據JSON的正確方法是什麼?
下面是兩個JSON響應返回數據
首先
[
{
"name": "Richard",
"bank_balance": 3000,
"assets_worth": 4000,
"total": 7000
},
{
"name": "John",
"bank_balance": 1000,
"assets_worth": 2000,
"total": 3000
},
{
"name": "Total",
"bank_balance":4000,
"assets_worth": 6000,
"total": 10000
}
]
二
{
"rows": [
{
"name": "Richard",
"bank_balance": 3000,
"assets_worth": 4000,
"total": 7000
},
{
"name": "John",
"bank_balance": 1000,
"assets_worth": 2000,
"total": 3000
}
],
"grand_total":
{
"name": "Total",
"bank_balance":4000,
"assets_worth": 6000,
"total": 10000
}
}
哪一個更正確的考慮REST的標準呢?