Package com.azure.android.core.http
Interface HttpCallback
-
public interface HttpCallback
The callback type to notify the result of an HTTP call.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onError(java.lang.Throwable error)
Called when theHttpRequest
call could not be executed due an error.void
onSuccess(HttpResponse response)
Called when theHttpResponse
is successfully returned by the HTTP server.
-
-
-
Method Detail
-
onSuccess
void onSuccess(HttpResponse response)
Called when theHttpResponse
is successfully returned by the HTTP server.Receiving a
HttpResponse
successfully does not necessarily indicate application-layer success; the responsestatusCode
may 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 theHttpRequest
call 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.
-
-