本文整理了Java中io.vertx.core.http.HttpClient.headNow()
方法的一些代码示例,展示了HttpClient.headNow()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpClient.headNow()
方法的具体详情如下:
包路径:io.vertx.core.http.HttpClient
类名称:HttpClient
方法名:headNow
[英]Sends an HTTP HEAD request to the server at the specified host and port, specifying a response handler to receive the response
[中]在指定的主机和端口向服务器发送HTTP HEAD请求,并指定接收响应的响应处理程序
代码示例来源:origin: vert-x3/vertx-rx
/**
* Sends an HTTP HEAD request to the server at the default host and port, specifying a response handler to receive
* the response
* @param requestURI the relative URI
* @param responseHandler the response handler
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.rxjava.core.http.HttpClient headNow(String requestURI, Handler<AsyncResult<io.vertx.rxjava.core.http.HttpClientResponse>> responseHandler) {
delegate.headNow(requestURI, new Handler<AsyncResult<io.vertx.core.http.HttpClientResponse>>() {
public void handle(AsyncResult<io.vertx.core.http.HttpClientResponse> ar) {
if (ar.succeeded()) {
responseHandler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.core.http.HttpClientResponse.newInstance(ar.result())));
} else {
responseHandler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
return this;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Sends an HTTP HEAD request to the server with the specified options, specifying a response handler to receive
* the response
* @param options the request options
* @param responseHandler the response handler
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.rxjava.core.http.HttpClient headNow(RequestOptions options, Handler<AsyncResult<io.vertx.rxjava.core.http.HttpClientResponse>> responseHandler) {
delegate.headNow(options, new Handler<AsyncResult<io.vertx.core.http.HttpClientResponse>>() {
public void handle(AsyncResult<io.vertx.core.http.HttpClientResponse> ar) {
if (ar.succeeded()) {
responseHandler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.core.http.HttpClientResponse.newInstance(ar.result())));
} else {
responseHandler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
return this;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Sends an HTTP HEAD request to the server at the specified host and default port, specifying a response handler to receive
* the response
* @param host the host
* @param requestURI the relative URI
* @param responseHandler the response handler
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.rxjava.core.http.HttpClient headNow(String host, String requestURI, Handler<AsyncResult<io.vertx.rxjava.core.http.HttpClientResponse>> responseHandler) {
delegate.headNow(host, requestURI, new Handler<AsyncResult<io.vertx.core.http.HttpClientResponse>>() {
public void handle(AsyncResult<io.vertx.core.http.HttpClientResponse> ar) {
if (ar.succeeded()) {
responseHandler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.core.http.HttpClientResponse.newInstance(ar.result())));
} else {
responseHandler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
return this;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* Sends an HTTP HEAD request to the server at the specified host and port, specifying a response handler to receive
* the response
* @param port the port
* @param host the host
* @param requestURI the relative URI
* @param responseHandler the response handler
* @return a reference to this, so the API can be used fluently
*/
public io.vertx.rxjava.core.http.HttpClient headNow(int port, String host, String requestURI, Handler<AsyncResult<io.vertx.rxjava.core.http.HttpClientResponse>> responseHandler) {
delegate.headNow(port, host, requestURI, new Handler<AsyncResult<io.vertx.core.http.HttpClientResponse>>() {
public void handle(AsyncResult<io.vertx.core.http.HttpClientResponse> ar) {
if (ar.succeeded()) {
responseHandler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.core.http.HttpClientResponse.newInstance(ar.result())));
} else {
responseHandler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
return this;
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Sends an HTTP HEAD request to the server with the specified options, specifying a response handler to receive
* the response
* @param options the request options
* @param responseHandler the response handler
* @return a reference to this, so the API can be used fluently
*/
@Deprecated()
public io.vertx.rxjava.core.http.HttpClient headNow(RequestOptions options, Handler<io.vertx.rxjava.core.http.HttpClientResponse> responseHandler) {
delegate.headNow(options, new Handler<io.vertx.core.http.HttpClientResponse>() {
public void handle(io.vertx.core.http.HttpClientResponse event) {
responseHandler.handle(io.vertx.rxjava.core.http.HttpClientResponse.newInstance(event));
}
});
return this;
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Sends an HTTP HEAD request to the server at the default host and port, specifying a response handler to receive
* the response
* @param requestURI the relative URI
* @param responseHandler the response handler
* @return a reference to this, so the API can be used fluently
*/
@Deprecated()
public io.vertx.rxjava.core.http.HttpClient headNow(String requestURI, Handler<io.vertx.rxjava.core.http.HttpClientResponse> responseHandler) {
delegate.headNow(requestURI, new Handler<io.vertx.core.http.HttpClientResponse>() {
public void handle(io.vertx.core.http.HttpClientResponse event) {
responseHandler.handle(io.vertx.rxjava.core.http.HttpClientResponse.newInstance(event));
}
});
return this;
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Sends an HTTP HEAD request to the server at the specified host and default port, specifying a response handler to receive
* the response
* @param host the host
* @param requestURI the relative URI
* @param responseHandler the response handler
* @return a reference to this, so the API can be used fluently
*/
@Deprecated()
public io.vertx.rxjava.core.http.HttpClient headNow(String host, String requestURI, Handler<io.vertx.rxjava.core.http.HttpClientResponse> responseHandler) {
delegate.headNow(host, requestURI, new Handler<io.vertx.core.http.HttpClientResponse>() {
public void handle(io.vertx.core.http.HttpClientResponse event) {
responseHandler.handle(io.vertx.rxjava.core.http.HttpClientResponse.newInstance(event));
}
});
return this;
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* Sends an HTTP HEAD request to the server at the specified host and port, specifying a response handler to receive
* the response
* @param port the port
* @param host the host
* @param requestURI the relative URI
* @param responseHandler the response handler
* @return a reference to this, so the API can be used fluently
*/
@Deprecated()
public io.vertx.rxjava.core.http.HttpClient headNow(int port, String host, String requestURI, Handler<io.vertx.rxjava.core.http.HttpClientResponse> responseHandler) {
delegate.headNow(port, host, requestURI, new Handler<io.vertx.core.http.HttpClientResponse>() {
public void handle(io.vertx.core.http.HttpClientResponse event) {
responseHandler.handle(io.vertx.rxjava.core.http.HttpClientResponse.newInstance(event));
}
});
return this;
}
代码示例来源:origin: io.vertx/vertx-lang-groovy
public static io.vertx.core.http.HttpClient headNow(io.vertx.core.http.HttpClient j_receiver, java.util.Map<String, Object> options, io.vertx.core.Handler<io.vertx.core.http.HttpClientResponse> responseHandler) {
io.vertx.core.impl.ConversionHelper.fromObject(j_receiver.headNow(options != null ? new io.vertx.core.http.RequestOptions(io.vertx.core.impl.ConversionHelper.toJsonObject(options)) : null,
responseHandler != null ? event -> responseHandler.handle(io.vertx.core.impl.ConversionHelper.fromObject(event)) : null));
return j_receiver;
}
public static io.vertx.core.http.HttpClientRequest options(io.vertx.core.http.HttpClient j_receiver, java.util.Map<String, Object> options) {
代码示例来源:origin: vietj/vertx-http-proxy
startProxy(new SocketAddressImpl(8081, "localhost"));
Async latch = ctx.async();
client.headNow(8080, "localhost", "/img.jpg", resp1 -> {
ctx.assertEquals(200, resp1.statusCode());
resp1.bodyHandler(buff -> {
内容来源于网络,如有侵权,请联系作者删除!