I get this error:
A connection to ****** was leaked. Did you forget to close a response body?
So, I continued and closed the answers that I receive.
response.body().close()
The problem is that response.body () is already converted to a user class, the available method is not available. I also tried calling raw and gave me an exception:
fetchSomething.enqueue(new Callback<SomethingClass>() {
@Override
public void onResponse(Call<SomethingClass> call, Response<SomethingClass> response) {
response.raw().body().close();
}
@Override
public void onFailure(Call<SomethingClass> call, Throwable t) {
}
});
}
How to close it?
source
share