The API interface code in my Android client is:
import com.zift.myapplication88.models.ServerRequest;
import com.zift.myapplication88.models.ServerResponse;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
public interface RequestInterface {
@POST("learn2crack-login-register/")
Call<ServerResponse> operation(@Body ServerRequest request);
}
I get the following error when I try to send data to server though:
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
I don't know where to edit in my code so I can make server return json
not string
.