Package io.micronaut.views.htmx.http
Interface HtmxRequestHeaders
public interface HtmxRequestHeaders
HTMX Request Headers.
- Since:
- 5.2.0
- Author:
- Sergio del Amo
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Indicates that the request comes from an element that uses hx-boost.static final String
The current URL of the browser.static final String
Indicates if the request is for history restoration after a miss in the local history cache.static final String
The user response to a hx-prompt.static final String
Only present andtrue
if the request is issued by htmx.static final String
Theid
of the target element if it exists.static final String
Theid
of the triggered element if it exists.static final String
Thename
of the triggered element if it exists. -
Method Summary
Modifier and TypeMethodDescription@Nullable String
@Nullable String
@Nullable String
@Nullable String
@Nullable String
@Nullable String
boolean
isBoost()
static Optional<HtmxRequestHeaders>
of
(io.micronaut.http.HttpHeaders headers) static @NonNull Optional<HtmxRequestHeaders>
of
(io.micronaut.http.HttpRequest<?> request)
-
Field Details
-
HX_BOOSTED
Indicates that the request comes from an element that uses hx-boost.- See Also:
-
HX_CURRENT_URL
The current URL of the browser.- See Also:
-
HX_HISTORY_RESTORE_REQUEST
Indicates if the request is for history restoration after a miss in the local history cache.- See Also:
-
HX_PROMPT
The user response to a hx-prompt.- See Also:
-
HX_REQUEST
Only present andtrue
if the request is issued by htmx.- See Also:
-
HX_TARGET
Theid
of the target element if it exists.- See Also:
-
HX_TRIGGER_NAME
Thename
of the triggered element if it exists.- See Also:
-
HX_TRIGGER
Theid
of the triggered element if it exists.- See Also:
-
-
Method Details
-
isBoost
boolean isBoost()- Returns:
- Indicates that the request is via an element using hx-boost
-
getCurrentUrl
- Returns:
- the current URL of the browser
-
getHistoryRestoreRequest
- Returns:
- “true” if the request is for history restoration after a miss in the local history cache
-
getPrompt
- Returns:
- the user response to an hx-prompt
-
getTarget
- Returns:
- the id of the target element if it exists
-
getTriggerName
- Returns:
- the name of the triggered element if it exists
-
getTrigger
- Returns:
- the id of the triggered element if it exists
-
of
- Parameters:
headers
- HTTP Headers- Returns:
- an Optional of HtmxRequestHeaders
-
of
- Parameters:
request
- HTTP Request- Returns:
- an Optional of HtmxRequestHeaders
-