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.

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