Interface RequestContext

  • All Known Implementing Classes:
    RequestContextImpl

    public interface RequestContext
    Context containing all important info about a request.
    • Method Detail

      • putHeader

        void putHeader​(java.lang.String name,
                       java.lang.String value)
      • containsHeader

        boolean containsHeader​(java.lang.String name)
      • removeHeader

        void removeHeader​(java.lang.String name)
      • getUri

        java.net.URI getUri()
      • getBody

        java.util.Optional<java.lang.Object> getBody()
      • addResponseCallback

        void addResponseCallback​(java.util.function.BiConsumer<ResponseContext,​java.lang.Exception> responseCallback)
        Adds a callback to be called when the request has finished. The responseCallback consumer is called with a non-null ResponseContext, if the HTTP request technically succeeded. The The responseCallback consumer is called with a non-null Exception object, if the HTTP request technically failed.
        Parameters:
        responseCallback - callback that receives either a non-null ResponseContext or a non-null Exception.
      • getResponseCallbacks

        java.util.List<java.util.function.BiConsumer<ResponseContext,​java.lang.Exception>> getResponseCallbacks()