Skip to main content

head

Attribute Macro head 

Source
#[head]
Expand description

Mark a function as a HEAD handler.

HEAD requests are identical to GET but return only headers, not body. Useful for checking resource existence or metadata without full content.

§Example

#[head("/items/{id}")]
async fn head_item(id: Path<i64>) -> StatusCode {
    StatusCode::OK
}