Interface ResponseProcessor<T>

  • Type Parameters:
    T - the type of the result generated by this processor
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface ResponseProcessor<T>

    An interface for components that process the response of an HTTP request and generate a result object.

    An object implementing this interface must be passed to HttpClient in order to execute a request. It is invoked when the response arrives. It has full access to all response data. This information can be used to either generate an arbitrary result object or fail with an appropriate exception.

    • Method Detail

      • process

        T process​(Response response)
           throws IOException
        Processes the response of a request to produce a result.
        Parameters:
        response - the response to be processed
        Returns:
        the result object to be propagated to the caller
        Throws:
        IOException - if an I/O error occurs