JSON error “Value at result of type java.lang.String cannot be converted to JSONArray” in android

前端 未结 1 1227
孤城傲影
孤城傲影 2021-01-25 23:14

I used the link for JSON RPC. I am getting a response as expected. But when i try to parse the response, it\'s giving me json error.

My code:

JSONEntity          


        
相关标签:
1条回答
  • 2021-01-25 23:53

    your result is actually returning a string not a json array. it will return json array if your json format would be like this

    {
      "id": 2,
      "result": [
        {
          "ExhibitorID": 42
        }
      ]
    }
    

    currently it is in this form:

    {
      "id": 2,
      "result": "[ {\"ExhibitorID\":42, etc....} ]"
    }
    
    0 讨论(0)
提交回复
热议问题