Package com.azure.android.core.http
Interface HttpCallback
-
public interface HttpCallbackThe callback type to notify the result of an HTTP call.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonError(java.lang.Throwable error)Called when theHttpRequestcall could not be executed due an error.voidonSuccess(HttpResponse response)Called when theHttpResponseis successfully returned by the HTTP server.
-
-
-
Method Detail
-
onSuccess
void onSuccess(HttpResponse response)
Called when theHttpResponseis successfully returned by the HTTP server.Receiving a
HttpResponsesuccessfully does not necessarily indicate application-layer success; the responsestatusCodemay still indicate an application-layer failure with error-codes such as 404 or 500.- Parameters:
response- The response for the HTTP call.
-
onError
void onError(java.lang.Throwable error)
Called when theHttpRequestcall could not be executed due an error.It is possible that the HTTP server received the request before the failure; examples for such failures are the client-side cancellation of the request written to the wire, the response read timeout, etc.
- Parameters:
error- The reason for call failure.
-
-