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
Just do it like this:
ModelClass modelclass=response.response.body()
System.out.println("****************-----retro rsp----1-------"+modelclass.getMessage());
in your model of response press cmd+n and override "toString" method and only call as response.toString();
@Override
public String toString() {
return "{" +
"key_one='" + var_keyone + '\'' +
", key_two='" + var_keytwo + '\'' +
'}';
}
With version 2.1.0, you can get the content as
public void onResponse(Call<T> call, Response<T> response) {
String errorString = response.errorBody().string();
}