Top Fields Constructors Methods
io.vertx.core.http.impl

public Class HttpClientBuilderImpl

extends Object
implements HttpClientBuilder
Class Inheritance
All Implemented Interfaces
io.vertx.core.http.HttpClientBuilder
Imports
io.vertx.core.Closeable, .Future, .Handler, io.vertx.core.http.*, io.vertx.core.impl.CloseFuture, .ContextInternal, .VertxInternal, java.util.function.Function

Field Summary

Modifier and TypeField and Description
private HttpClientOptions
private Handler<HttpConnection>
private PoolOptions
private Function<HttpClientResponse, Future<RequestOptions>>
private final VertxInternal

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public HttpClient
build()

Implements io.vertx.core.http.HttpClientBuilder.build.

Build and return the client.

private CloseFuture
public HttpClientBuilder
with(HttpClientOptions
the client options
options
)

Implements io.vertx.core.http.HttpClientBuilder.with.

Configure the client options.

public HttpClientBuilder
with(PoolOptions
the pool options
options
)

Implements io.vertx.core.http.HttpClientBuilder.with.

Configure the client with the given pool options.

public HttpClientBuilder
withConnectHandler(Handler<HttpConnection> handler)

Implements io.vertx.core.http.HttpClientBuilder.withConnectHandler.

Set a connection handler for the client.

public HttpClientBuilder
withRedirectHandler(Function<HttpClientResponse, Future<RequestOptions>>
the new redirect handler
handler
)

Implements io.vertx.core.http.HttpClientBuilder.withRedirectHandler.

Set a redirect handler for the http client.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clientOptionsback to summary
private HttpClientOptions clientOptions
connectHandlerback to summary
private Handler<HttpConnection> connectHandler
poolOptionsback to summary
private PoolOptions poolOptions
redirectHandlerback to summary
private Function<HttpClientResponse, Future<RequestOptions>> redirectHandler
vertxback to summary
private final VertxInternal vertx

Constructor Detail

HttpClientBuilderImplback to summary
public HttpClientBuilderImpl(VertxInternal vertx)

Method Detail

buildback to summary
public HttpClient build()

Implements io.vertx.core.http.HttpClientBuilder.build.

Doc from io.vertx.core.http.HttpClientBuilder.build.

Build and return the client.

Returns:HttpClient

the client as configured by this builder

Annotations
@Override
resolveCloseFutureback to summary
private CloseFuture resolveCloseFuture()
withback to summary
public HttpClientBuilder with(HttpClientOptions options)

Implements io.vertx.core.http.HttpClientBuilder.with.

Doc from io.vertx.core.http.HttpClientBuilder.with.

Configure the client options.

Parameters
options:HttpClientOptions

the client options

Returns:HttpClientBuilder

a reference to this, so the API can be used fluently

Annotations
@Override
withback to summary
public HttpClientBuilder with(PoolOptions options)

Implements io.vertx.core.http.HttpClientBuilder.with.

Doc from io.vertx.core.http.HttpClientBuilder.with.

Configure the client with the given pool options.

Parameters
options:PoolOptions

the pool options

Returns:HttpClientBuilder

a reference to this, so the API can be used fluently

Annotations
@Override
withConnectHandlerback to summary
public HttpClientBuilder withConnectHandler(Handler<HttpConnection> handler)

Implements io.vertx.core.http.HttpClientBuilder.withConnectHandler.

Doc from io.vertx.core.http.HttpClientBuilder.withConnectHandler.

Set a connection handler for the client. This handler is called when a new connection is established.

Returns:HttpClientBuilder

a reference to this, so the API can be used fluently

Annotations
@Override
withRedirectHandlerback to summary
public HttpClientBuilder withRedirectHandler(Function<HttpClientResponse, Future<RequestOptions>> handler)

Implements io.vertx.core.http.HttpClientBuilder.withRedirectHandler.

Doc from io.vertx.core.http.HttpClientBuilder.withRedirectHandler.

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<HttpClientRequest> 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<HttpClientRequest> unsent so the client can further configure it and send it.

Parameters
handler:Function<HttpClientResponse, Future<RequestOptions>>

the new redirect handler

Returns:HttpClientBuilder

a reference to this, so the API can be used fluently

Annotations
@Override