Interface Hooks


public interface Hooks
Callbacks invoked for every HTTP attempt (SPEC section 2.5). URLs and headers are redacted. Exceptions thrown by a hook are caught and ignored.
  • Field Details

    • NONE

      static final Hooks NONE
      Hooks that do nothing.
  • Method Details

    • onRequest

      default void onRequest(Hooks.RequestInfo info)
      Called before each attempt.
      Parameters:
      info - request data
    • onResponse

      default void onResponse(Hooks.ResponseInfo info)
      Called when an attempt received a response (any status).
      Parameters:
      info - response data
    • onError

      default void onError(Hooks.ErrorInfo info)
      Called when an attempt failed (network error, timeout or error status).
      Parameters:
      info - error data