Interface HttpCallback


  • public interface HttpCallback
    The callback type to notify the result of an HTTP call.
    • Method Detail

      • onSuccess

        void onSuccess​(HttpResponse response)
        Called when the HttpResponse is successfully returned by the HTTP server.

        Receiving a HttpResponse successfully does not necessarily indicate application-layer success; the response statusCode 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 the HttpRequest 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.