Generally, the content returned by the backend includes the return code, array, and prompt information. generally, how can we name the returned array, in other words, there is more than one layer of json. Generally, the content returned by the backend includes the return code, array, and prompt information.
How do you name
In addition, the returned array is generally json once, or a layer of json
Reply content:
Generally, the content returned by the backend includes the return code, array, and prompt information.
How do you name
In addition, the returned array is generally json once, or a layer of json
Refer to the following
{Status: 1, // data Status Code: 200, // reverse Code Status Message: 'Successful ', // description information ClientTime: 1473765898, // client request time ServerTime: 1473765935, // server response time token: '38ce6474a370c3fe84ddf92403bec204cfcbe07b ', // The unique token can also be used to encrypt key data: {// json data. the format level relationship can be set as needed, although key1: value1, key2: value2, key3: {[name: 'xiaoming ', sex: 1,], [name: 'xiaohua', sex: 1,], [name: 'xiaogang ', sex: 1,]}
errNo=>errMsg=>data=>
Then the json_encode array
{ code:200, message: "success", data: { key1: value1, key2: value2, ... }}
Code: error code
Message: description, "success" when successful, and error
Data: the data returned when the operation is successful. the type is an object or an array.
Successful:
{"Code": "200", "data": "data is returned successfully. if no data is returned, an empty array [] is returned."}
When an error occurs:
{"Code": "Error code", "msg": "error message "}