Interface Interceptor

    • Method Detail

      • before

        default void before​(BasicBuilder builder,
                            HttpRequest request,
                            Interceptor.RequestTags tags)
        Called before a request to allow for the manipulation of the request
        Parameters:
        builder - used to modify the request
        request - the current request
      • after

        default void after​(HttpRequest request,
                           HttpResponse<?> response,
                           AsyncBody.Consumer<List<ByteBuffer>> consumer)
        Called after a non-WebSocket HTTP response is received. The body might or might not be already consumed.

        Should be used to analyze response codes and headers, original response shouldn't be altered.

        Parameters:
        request - the original request sent to the server.
        response - the response received from the server.
      • afterConnectionFailure

        default void afterConnectionFailure​(HttpRequest request,
                                            Throwable failure)
        Called after a connection attempt fails.

        This method will be invoked on each failed connection attempt.

        Parameters:
        request - the HTTP request.
        failure - the Java exception that caused the failure.