我有这种方法:
client.newCall(request).enqueue(new okhttp3.Callback() {
@Override
public void onFailure(Call call, IOException e) {
callback.onFail(e.getMessage());
}
@Override
public void onResponse(Call call, okhttp3.Response response) throws IOException {
Gson gson = new Gson();
String body = response.body().string();
Response _response = gson.fromJson(body, Response.class);
callback.onCallBack(_response);
}
});
但是我收到一条错误消息: com.google.gson.JsonSyntaxException:java.lang.IllegalStateException:预期为BEGIN_OBJECT,但位于第1行第1列的路径$