[英]How to solve java.lang.IllegalStateException: server in wrong state Exception
[英]how to make server return json not string (java.lang.IllegalStateException)
我的Android客户端中的API接口代码为:
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);
}
我尝试将数据发送到服务器时收到以下错误:
com.google.gson.JsonSyntaxException:java.lang.IllegalStateException:预期为BEGIN_OBJECT,但位于第1行第1列的路径$
我不知道在代码中的哪里编辑,所以我可以使服务器返回json
而不是string
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.