Class HttpClientBuilder

java.lang.Object
io.vertx.reactivex.core.http.HttpClientBuilder
All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate

public class HttpClientBuilder extends Object implements io.vertx.lang.rx.RxDelegate
A builder for HttpClient.

NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.

  • Field Details

    • __TYPE_ARG

      public static final io.vertx.lang.rx.TypeArg<HttpClientBuilder> __TYPE_ARG
  • Constructor Details

    • HttpClientBuilder

      public HttpClientBuilder(HttpClientBuilder delegate)
    • HttpClientBuilder

      public HttpClientBuilder(Object delegate)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getDelegate

      public HttpClientBuilder getDelegate()
      Specified by:
      getDelegate in interface io.vertx.lang.rx.RxDelegate
    • with

      public HttpClientBuilder with(HttpClientOptions options)
      Configure the client options.
      Parameters:
      options - the client options
      Returns:
      a reference to this, so the API can be used fluently
    • with

      public HttpClientBuilder with(HttpClientConfig config)
      Configure the client.
      Parameters:
      config - the client config
      Returns:
      a reference to this, so the API can be used fluently
    • with

      public HttpClientBuilder with(PoolOptions options)
      Configure the client with the given pool options.
      Parameters:
      options - the pool options
      Returns:
      a reference to this, so the API can be used fluently
    • with

      public HttpClientBuilder with(ClientSSLOptions options)
      Configure the client with the given SSL options.
      Parameters:
      options - the SSL options
      Returns:
      a reference to this, so the API can be used fluently
    • with

      public HttpClientBuilder with(SSLEngineOptions engine)
      Configure the client with the given SSL engine.
      Parameters:
      engine - the SSL engine options
      Returns:
      a reference to this, so the API can be used fluently
    • withConnectHandler

      public HttpClientBuilder withConnectHandler(Handler<HttpConnection> handler)
      Set a connection handler for the client. This handler is called when a new connection is established.
      Parameters:
      handler -
      Returns:
      a reference to this, so the API can be used fluently
    • withRedirectHandler

      public HttpClientBuilder withRedirectHandler(Function<HttpClientResponse, Future<RequestOptions>> handler)
      Set a redirect handler for the http client.

      The redirect handler is called when a 3xx response is received and the request is configured to follow redirects with HttpClientRequest.setFollowRedirects(boolean).

      The redirect handler is passed the HttpClientResponse, it can return an HttpClientRequest or null.

      • when null is returned, the original response is processed by the original request response handler
      • when a new Future is returned, the client will send this new request
      The new request will get a copy of the previous request headers unless headers are set. In this case, the client assumes that the redirect handler exclusively managers the headers of the new request.

      The handler must return a Future unsent so the client can further configure it and send it.

      Parameters:
      handler - the new redirect handler
      Returns:
      a reference to this, so the API can be used fluently
    • withRedirectHandler

      public HttpClientBuilder withRedirectHandler(Function<HttpClientResponse, Single<RequestOptions>> handler)
      Set a redirect handler for the http client.

      The redirect handler is called when a 3xx response is received and the request is configured to follow redirects with HttpClientRequest.setFollowRedirects(boolean).

      The redirect handler is passed the HttpClientResponse, it can return an HttpClientRequest or null.

      • when null is returned, the original response is processed by the original request response handler
      • when a new Future is returned, the client will send this new request
      The new request will get a copy of the previous request headers unless headers are set. In this case, the client assumes that the redirect handler exclusively managers the headers of the new request.

      The handler must return a Future unsent so the client can further configure it and send it.

      Parameters:
      handler - the new redirect handler
      Returns:
      a reference to this, so the API can be used fluently
    • build

      public HttpClientAgent build()
      Build and return the client.
      Returns:
      the client as configured by this builder
    • withAddressResolver

      public HttpClientBuilder withAddressResolver(AddressResolver<?> resolver)
      Configure the client to use a specific address resolver.
      Parameters:
      resolver - the address resolver
      Returns:
    • withLoadBalancer

      public HttpClientBuilder withLoadBalancer(LoadBalancer loadBalancer)
      Configure the client to use a load balancer.
      Parameters:
      loadBalancer - the load balancer
      Returns:
    • newInstance

      public static HttpClientBuilder newInstance(HttpClientBuilder arg)