我正在为安卓开发一个应用程序,当我提交GET
时,REST Server会返回以下JSON答案
{
"result": "ok",
"code": 1000,
"code_desc": "Command Done Successfully",
"method": "get",
"call_id": null,
"timestamp": 1539100644,
"weight": {
"1": {
"id": 1,
"customer_id": 1,
"date": "2018-10-04 12:02:00",
"value": 100,
"observations": ""
},
"2": {
"id": 2,
"customer_id": 1,
"date": "2018-10-04 12:02:00",
"value": 100,
"observations": ""
}
},
"order": "date",
"sorder": "ASC",
"total": 2
}
JSON是有效的,但是当我尝试读取内容时,它返回null
。我认为这是因为物体重量的形成不好。
是否应该更改来自服务器的JSON?类似这样的东西:
{
"result": "ok",
"code": 1000,
"code_desc": "Command Done Successfully",
"method": "get",
"call_id": null,
"timestamp": 1539100644,
"weight": [{
"id": 1,
"customer_id": 1,
"date": "2018-10-04 12:02:00",
"value": 100,
"observations": ""
},
{
"id": 2,
"customer_id": 1,
"date": "2018-10-04 12:02:00",
"value": 100,
"observations": ""
}
],
"order": "date",
"sorder": "ASC",
"total": 2
}
https://stackoverflow.com/questions/52730208
复制相似问题