Class BaseRxHttpClient

  • All Implemented Interfaces:
    RxHttpClient, java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    RxJavaHttpClient

    public abstract class BaseRxHttpClient
    extends java.lang.Object
    implements RxHttpClient
    A Reactive HTTP Client Created by Karel Maesen, Geovise BVBA on 05/12/14.
    • Method Detail

      • execute

        public <F> java.util.concurrent.CompletableFuture<F> execute​(ClientRequest request,
                                                                     java.util.function.Function<ServerResponse,​F> transformer)
        * Executes a request and returns an Observable for the complete response.
        Specified by:
        execute in interface RxHttpClient
      • executeAndDechunk

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

        All ServerResponseElements are filtered out, ResponseBodyParts are turned into (UTF8) Strings, and the chunks are combined and split at the specified 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.

        Specified by:
        executeAndDechunk in interface RxHttpClient
        Parameters:
        request - the request to send
        separator - the separator
        Returns:
        a cold Flowable of messages (UTF8 Strings)
      • getBaseUrl

        public java.lang.String getBaseUrl()
        Returns the base URL that this client connects to.
        Specified by:
        getBaseUrl in interface RxHttpClient
        Returns:
        the base URL that this client connects to.
      • getAccept

        public java.lang.String getAccept()
        Returns the configured default ACCEPT header for requests created using this instance's ClientRequestBuilders.
        Specified by:
        getAccept in interface RxHttpClient
        Returns:
        the configured default ACCEPT header for requests created using this instance's ClientRequestBuilders.
      • close

        public void close()
        Closes the underlying connection
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface RxHttpClient
      • inner

        public org.asynchttpclient.AsyncHttpClient inner()
        Specified by:
        inner in interface RxHttpClient