Error: Type of “status“ (number) is not supported. Use objects or arrays of objects.

An error is reported when requesting JSON Server server data

The previous json data:


  "status": 200,
  "data": [
    {
      "image": "http://iwenwiki.com:3002/images/savefood1.jpg",

      "title": "123"
    },
    {
      "image": "http://iwenwiki.com:3002/images/savefood1.jpg",

      "title": "456"
    }

  ]

Using this data will report the following error:

It means: the number 0 should not be directly followed by the status but should be followed by an Object object or an array object.

So after modifying the data:

"status": {
    "status": 200
  },
  "data": [
    {
      "image": "http://iwenwiki.com:3002/images/savefood1.jpg",

      "title": "123"
    },
     {
      "image": "http://iwenwiki.com:3002/images/savefood1.jpg",

      "title": "456"
    }
  
  ]

Guess you like

Origin blog.csdn.net/m0_51744718/article/details/129128450