Example usage for io.vertx.core.http HttpClient headNow

List of usage examples for io.vertx.core.http HttpClient headNow

Introduction

In this page you can find the example usage for io.vertx.core.http HttpClient headNow.

Prototype

@Fluent
default HttpClient headNow(String requestURI, Handler<AsyncResult<HttpClientResponse>> responseHandler) 

Source Link

Document

Sends an HTTP HEAD request to the server at the default host and port, specifying a response handler to receive the response

Usage

From source file:examples.HTTPExamples.java

License:Open Source License

public void example32(Vertx vertx) {
    HttpClient client = vertx.createHttpClient();

    // Send a GET request
    client.getNow("/some-uri", response -> {
        System.out.println("Received response with status code " + response.statusCode());
    });/* ww  w .  jav  a 2s.  c o m*/

    // Send a GET request
    client.headNow("/other-uri", response -> {
        System.out.println("Received response with status code " + response.statusCode());
    });

}