Retrofit callback get response body

前端 未结 9 1212
星月不相逢
星月不相逢 2020-12-05 04:05

I am testing Retrofit to compare it with Volley and I am struggling to get the response from my requests. For example, I do something like this:

RestAdapter          


        
9条回答
  •  春和景丽
    2020-12-05 04:59

    With version 2.1.0, you can get the content as

    public void onResponse(Call call, Response response) {
        String errorString = response.errorBody().string();
    }
    

提交回复
热议问题