==== HeadHandler

By default, Jooby does not automatically handle `HTTP HEAD` requests. To support them without manually defining `head(...)` routes for every resource, you can use the javadoc:handler.HeadHandler[].

The javadoc:handler.HeadHandler[] automatically routes `HEAD` requests to your existing `GET` handlers.

.Usage
[source, java, role = "primary"]
----
import io.jooby.handler.HeadHandler;

{
  use(new HeadHandler()); // <1>
  
  get("/", ctx -> "Full response body");
}
----

.Kotlin
[source, kotlin, role = "secondary"]
----
import io.jooby.handler.HeadHandler

{
  use(HeadHandler())      // <1>
  
  get("/") { "Full response body" }
}
----

<1> Install the `HeadHandler`.

When a `HEAD` request is received, the corresponding `GET` handler is executed to compute response metadata (like `Content-Length` and other headers), but the actual response body is stripped before being sent to the client.

[NOTE]
====
This handler is a convenient way to support `HEAD` requests globally, but keep in mind that the `GET` handler logic still runs. If your `GET` handler performs expensive operations to generate a body, you might prefer a custom implementation that skips body generation for `HEAD` requests.
====
