【发布时间】:2016-12-30 01:49:36
【问题描述】:
Gson gson = new Gson();
String json = gson.toJson(account);
System.out.println(json);
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), json);
p2PApi.createDepositAcct(body).enqueue(new Callback<Create>() {
@Override
public void onResponse(Call<Create> call, Response<Create> response) {
try {
System.out.println(response.code());
System.out.println(response.errorBody().string());
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onFailure(Call<Create> call, Throwable t) {
}
});
这是我的代码,响应成功,但是 response.code()=518 和 响应消息在 response.errorBody() 中,reponse.body() 为空。
那为什么要回复 518 呢?
518 是什么意思?
【问题讨论】:
标签: java android http retrofit2