Android Retrofit Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ Android Retrofit Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $ json json

Android Retrofit Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $


if you sure the postman work, and the model same as the JSON parameter,

maybe you use the "accept-encoding: gzip" or like that in your request header.

retrofit doesn't work with gzip, remove that from the header.


If the source code that you posted for the Member class is accurate, then you are not getting the response JSON that you think you are.

The error message means that the JSON parser found a String where it expected a complex object.

Since you don't have any complex objects in the Member class, the result probably just isn't valid JSON (it doesn't start with an opening curly bracket).

Try either turning on verbose logging in Retrofit as suggested in one of the comments, or posting the same data to the API using a tool like "Postman", and see what the result actually is.


This is cause .your respons is not json formated . it may include with string or expected } . to identify this .you have to check with postman and change view type in body as HTML . there you can see full response and you can validate with *https://jsonlint.com/ . else in the case of Dynamic json . you can use JsonElement as response.