本文整理了Java中io.vertx.core.http.HttpClient.redirectHandler()
方法的一些代码示例,展示了HttpClient.redirectHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpClient.redirectHandler()
方法的具体详情如下:
包路径:io.vertx.core.http.HttpClient
类名称:HttpClient
方法名:redirectHandler
暂无
代码示例来源:origin: eclipse-vertx/vert.x
Function<HttpClientResponse, Future<HttpClientRequest>> handler = client.redirectHandler();
Future<HttpClientRequest> redirection = handler.apply(resp);
if (expected != null) {
代码示例来源:origin: eclipse-vertx/vert.x
});
startServer(server2);
client.redirectHandler(resp -> {
Future<HttpClientRequest> fut = Future.future();
vertx.setTimer(25, id -> {
代码示例来源:origin: io.vertx/vertx-core
Function<HttpClientResponse, Future<HttpClientRequest>> handler = client.redirectHandler();
Future<HttpClientRequest> redirection = handler.apply(resp);
if (expected != null) {
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Set a redirect handler for the http client.
* <p>
* The redirect handler is called when a <code>3xx</code> response is received and the request is configured to
* follow redirects with {@link io.vertx.rxjava.core.http.HttpClientRequest#setFollowRedirects}.
* <p>
* The redirect handler is passed the {@link io.vertx.rxjava.core.http.HttpClientResponse}, it can return an {@link io.vertx.rxjava.core.http.HttpClientRequest} or <code>null</code>.
* <ul>
* <li>when null is returned, the original response is processed by the original request response handler</li>
* <li>when a new <code>Future<HttpClientRequest></code> is returned, the client will send this new request</li>
* </ul>
* 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.
* <p>
* The handler must return a <code>Future<HttpClientRequest></code> unsent so the client can further configure it and send it.
* @param handler the new redirect handler
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.rxjava.core.http.HttpClient redirectHandler(Function<io.vertx.rxjava.core.http.HttpClientResponse, io.vertx.rxjava.core.Future<io.vertx.rxjava.core.http.HttpClientRequest>> handler) {
delegate.redirectHandler(new java.util.function.Function<io.vertx.core.http.HttpClientResponse,io.vertx.core.Future<io.vertx.core.http.HttpClientRequest>>() {
public io.vertx.core.Future<io.vertx.core.http.HttpClientRequest> apply(io.vertx.core.http.HttpClientResponse arg) {
io.vertx.rxjava.core.Future<io.vertx.rxjava.core.http.HttpClientRequest> ret = handler.apply(io.vertx.rxjava.core.http.HttpClientResponse.newInstance(arg));
return ret.getDelegate();
}
});
return this;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Set a redirect handler for the http client.
* <p>
* The redirect handler is called when a <code>3xx</code> response is received and the request is configured to
* follow redirects with {@link io.vertx.rxjava.core.http.HttpClientRequest#setFollowRedirects}.
* <p>
* The redirect handler is passed the {@link io.vertx.rxjava.core.http.HttpClientResponse}, it can return an {@link io.vertx.rxjava.core.http.HttpClientRequest} or <code>null</code>.
* <ul>
* <li>when null is returned, the original response is processed by the original request response handler</li>
* <li>when a new <code>Future<HttpClientRequest></code> is returned, the client will send this new request</li>
* </ul>
* 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.
* <p>
* The handler must return a <code>Future<HttpClientRequest></code> unsent so the client can further configure it and send it.
* @param handler the new redirect handler
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.rxjava.core.http.HttpClient redirectHandler(Function<io.vertx.rxjava.core.http.HttpClientResponse, io.vertx.rxjava.core.Future<io.vertx.rxjava.core.http.HttpClientRequest>> handler) {
delegate.redirectHandler(new java.util.function.Function<io.vertx.core.http.HttpClientResponse,io.vertx.core.Future<io.vertx.core.http.HttpClientRequest>>() {
public io.vertx.core.Future<io.vertx.core.http.HttpClientRequest> apply(io.vertx.core.http.HttpClientResponse arg) {
io.vertx.rxjava.core.Future<io.vertx.rxjava.core.http.HttpClientRequest> ret = handler.apply(io.vertx.rxjava.core.http.HttpClientResponse.newInstance(arg));
return ret.getDelegate();
}
});
return this;
}
代码示例来源:origin: io.vertx/vertx-core
});
startServer(server2);
client.redirectHandler(resp -> {
Future<HttpClientRequest> fut = Future.future();
vertx.setTimer(25, id -> {
内容来源于网络,如有侵权,请联系作者删除!