T
- Successful response body type.public interface Callback<T>
Callback methods are executed using the Retrofit
callback executor. When none is
specified, the following defaults are used:
Modifier and Type | Method and Description |
---|---|
void |
onFailure(Call<T> call,
java.lang.Throwable t)
Invoked when a network exception occurred talking to the server or when an unexpected exception
occurred creating the request or processing the response.
|
void |
onResponse(Call<T> call,
Response<T> response)
Invoked for a received HTTP response.
|
void onResponse(Call<T> call, Response<T> response)
Note: An HTTP response may still indicate an application-level failure such as a 404 or 500.
Call Response.isSuccessful()
to determine if the response indicates success.