Interface RxHttpClient

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    All Known Implementing Classes:
    BaseRxHttpClient, RxJavaHttpClient

    public interface RxHttpClient
    extends java.io.Closeable
    Created by Karel Maesen, Geovise BVBA on 2019-07-12.
    • Method Detail

      • execute

        <F> java.util.concurrent.CompletableFuture<F> execute​(ClientRequest request,
                                                              java.util.function.Function<ServerResponse,​F> transformer)
      • executeToCompletion

        <F> org.reactivestreams.Publisher<F> executeToCompletion​(ClientRequest request,
                                                                 java.util.function.Function<ServerResponse,​F> transformer)
        Executes a request and returns an Observable for the complete response.

        The returned Observable is Cold, i.e. on each subscription a new HTTP request is made and the response elements returned as a new Observable. So for each subscriber, a separate HTTP request will be made.

        Type Parameters:
        F - the type of return value
        Parameters:
        request - the request to send
        transformer - a function that transforms the ServerResponse to a value of F
        Returns:
        An Observable that returns the transformed server response.
      • executeObservably

        org.reactivestreams.Publisher<ServerResponseElement> executeObservably​(ClientRequest request)
        Returns a "cold" Observable for a stream of ServerResponseElements.

        The returned Observable is Cold, i.e. on each subscription a new HTTP request is made and the response elements returned as a new Observable. So for each subscriber, a separate HTTP request will be made.

        Parameters:
        request - the request to send
        Returns:
        a cold observable of ServerResponseElements
      • executeAndDechunk

        org.reactivestreams.Publisher<java.lang.String> executeAndDechunk​(ClientRequest request,
                                                                          java.lang.String separator)
      • executeAndDechunk

        org.reactivestreams.Publisher<java.lang.String> executeAndDechunk​(ClientRequest request,
                                                                          java.lang.String separator,
                                                                          java.nio.charset.Charset charset)
        Returns a "cold" Observable for a stream of messages.

        All ServerResponseElements are filtered out, ResponseBodyParts are turned into Strings in the specified charset, and the chunks are combined and split at the separator characters.

        The returned Observable is Cold, i.e. on each subscription a new HTTP request is made and the response elements returned as a new Observable. So for each subscriber, a separate HTTP request will be made.

        Parameters:
        request - the request to send
        separator - the separator
        charset - the character set of the messages
        Returns:
        a cold Flowable of messages (Strings in the specified Charset)
      • executeObservably

        <F> org.reactivestreams.Publisher<F> executeObservably​(ClientRequest request,
                                                               java.util.function.Function<byte[],​F> transform)
        Returns a "cold" Observable for a stream of T.

        The returned Observable is Cold, i.e. on each subscription a new HTTP request is made and the response elements returned as a new Observable. So for each subscriber, a separate HTTP request will be made.

        Type Parameters:
        F - return type of the transform
        Parameters:
        request - the request to send
        transform - the function that transforms the response body (chunks) into objects of type F
        Returns:
        a cold observable of ServerResponseElements
      • getBaseUrl

        java.lang.String getBaseUrl()
      • getAccept

        java.lang.String getAccept()
      • getRequestSigners

        java.util.List<RequestSigner> getRequestSigners()
      • close

        void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • toLogMessage

        java.lang.String toLogMessage​(ClientRequest request)
      • inner

        org.asynchttpclient.AsyncHttpClient inner()
      • getMaxConnections

        int getMaxConnections()