I am using retrofit 1.9 and i created logout method as
@GET("/user/logout")
void logoutUser(Callback<Response> callback);
logoutUser(new RequestCallback<Response>(this) {
@Override
public void success(Response response, Response response2) {
settingsService.setUserLoggedOut();
getMainActivity().finish();
}
});
i upgraded it to retrofit 2.0 beta 4 and used this code
@GET("user/logout")
Call<Response> logoutUser();
logoutUser().enqueue(new RequestCallback<Response>(this) {
@Override
public void onResponse(Call<Response> call, Response<Response> response) {
settingsService.setUserLoggedOut();
getMainActivity().finish();
}
});
I have this exception : java.lang.IllegalArgumentException: 'retrofit2.Response' is not a valid response body type. Did you mean ResponseBody?
what is the problem?