“Expected BEGIN_OBJECT but was STRING at line 1 column 1”

前端 未结 14 2449
误落风尘
误落风尘 2020-11-22 01:11

I have this method:

public static Object parseStringToObject(String json) {
    String Object = json;
    Gson gson = new Gson();
    Object objects = gson.f         


        
14条回答
  •  日久生厌
    2020-11-22 02:02

    In my case, I am Returning JSON Object as

    {"data":"","message":"Attendance Saved Successfully..!!!","status":"success"}

    Resolved by changing it as

    {"data":{},"message":"Attendance Saved Successfully..!!!","status":"success"}

    Here data is a sub JsonObject and it should starts from { not ""

提交回复
热议问题