category

# `http_router_htmx`

Optional HTMX middleware helpers for router objects importing the `http_router` category.

Availability:
`logtalk_load(http_htmx(loader))`
Author: Paulo Moura
Version: 1:0:0
Date: 2026-06-26
Compilation flags:
`static`
Uses:
http_core
http_htmx
list
Remarks:
(none)
Inherited public predicates:
(none)

## Public predicates

(no local declarations; see entity ancestors if any)

## Protected predicates

### `annotate_htmx_request/2`

Router middleware helper that annotates a normalized request with derived HTMX properties and continues the middleware chain.

Compilation flags:
`static`
Template:
`annotate_htmx_request(Request,Action)`
Mode and number of proofs:
`annotate_htmx_request(+compound,-compound)` - `one_or_error`
Exceptions:
`Request` is not a valid normalized HTTP request term:
`domain_error(http_request,Request)`
The annotated request violates normalized HTTP request semantics:
`domain_error(http_header_semantics,Header)`
The annotated request properties violate normalized HTTP request semantics:
`domain_error(http_property_semantics,Property)`

### `add_htmx_response_headers/3`

Router response-middleware helper that decorates a normalized response using `htmx_response_options/1` request or response properties.

Compilation flags:
`static`
Template:
`add_htmx_response_headers(Request,Response0,Response)`
Mode and number of proofs:
`add_htmx_response_headers(+compound,+compound,-compound)` - `one_or_error`
Exceptions:
`Request` is not a valid normalized HTTP request term:
`domain_error(http_request,Request)`
`Response0` is not a valid normalized HTTP response term:
`domain_error(http_response,Response0)`
The derived HTMX response options are invalid:
`domain_error(option,Option)`
The decorated response violates normalized HTTP response semantics:
`domain_error(http_header_semantics,Header)`

## Private predicates

(no local declarations; see entity ancestors if any)

## Operators

(none)