Callback

interface Callback<T>

Communicates responses from a server or offline requests. One and only one method will be invoked in response to a given request.

Parameters

T

successful response body type

Functions

Link copied to clipboard
abstract fun onFailure(call: Call<T>, t: Throwable)

Invoked when a network exception occurred talking to the server or when an unexpected exception occurred creating the request or processing the response.

Link copied to clipboard
abstract fun onSuccess(call: Call<T>, response: T)

Invoked for a received response.