Retrofit2 Error : java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

Viewed 817

I am trying to pass an arraylist to php to do some operations. when i tested with postman i got the following resoponse..

{"correct_answers":"2","total_question":"5","message":"Great!. You need to score at least 60% of marks to move next level..","message_percentage":"40","saved_message":"success"}

enter image description here

But when I try to send the request i am getting this error..

java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

this is my api interface

@POST("questions.php")

@FormUrlEncoded

Call<QuestionResult> correctQuestionData(@Field("tag") String tag, @Field("str_question_answer[]") ArrayList<QuestionAnswers> str_question_answer,
                                         @Field("student_id")  String student_id, @Field("level") String level);
2 Answers
Related