我正在研究 RESTful API。我们的一个屏幕显示了总计的表格。
下面是返回数据的两个 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 标准,哪一个更正确?