Http module

head

procedure · 3 overloadsSource

HEAD and OPTIONS are answered for every route by default (HEAD by the GET handler without the body, OPTIONS with an Allow list); register them only to change that. Adds a HEAD route. Register one only to change the default, which answers HEAD from the GET handler without sending the body. The template, handler and max_body work as for get.

head :: (
    app: *App,
    $template: string,
    $handler: $H,
    max_body := 0,
    $loc := #caller_location
)

HEAD and OPTIONS are answered for every route by default (HEAD by the GET handler without the body, OPTIONS with an Allow list); register them only to change that. Adds a HEAD route. Register one only to change the default, which answers HEAD from the GET handler without sending the body. The template, handler and max_body work as for get.

Parameters

app: *App
$template: string
$handler: $H
max_body := 0
$loc := #caller_location
head :: (
    group: *Group($P),
    $template: string,
    $handler: $H,
    max_body := 0,
    $loc := #caller_location
)

The head for a route under a group's prefix.

Parameters

group: *Group($P)
$template: string
$handler: $H
max_body := 0
$loc := #caller_location
head :: (
    client: *Client,
    url: string,
    headers: [] Header_Field = .[]
) -> (Client_Response, Client_Error)

HEAD: the headers a GET would get, and no body. The response is returned as get does.

Parameters

client: *Client
url: string
headers: [] Header_Field

Returns

See also