vertx / io.vertx.reactivex.core.http / HttpClient / redirectHandler

# redirectHandler

`open fun redirectHandler(handler: Function<HttpClientResponse, Future<HttpClientRequest>>): HttpClient`

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 `io.vertx.reactivex.core.http.HttpClientRequest#setFollowRedirects`.

The redirect handler is passed the io.vertx.reactivex.core.http.HttpClientResponse, it can return an io.vertx.reactivex.core.http.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 handler must return a `Future` unsent so the client can further configure it and send it.

### Parameters

`handler` - the new redirect handler

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