mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-27 13:01:03 +00:00
879 B
879 B
+++
title = "hx-request"
description = """
The hx-request attribute in htmx allows you to configure the request timeout, whether the request will send
credentials, and whether the request will include headers."""
+++
The hx-request
attribute allows you to configure various aspects of the request via the following attributes:
timeout
- the timeout for the request, in millisecondscredentials
- if the request will send credentialsnoHeaders
- strips all headers from the request
These attributes are set using a JSON-like syntax:
<div ... hx-request='{"timeout":100}'>
...
</div>
You may make the values dynamically evaluated by adding the javascript:
or js:
prefix:
<div ... hx-request='js: timeout:getTimeoutSetting() '>
...
</div>
Notes
hx-request
is merge-inherited and can be placed on a parent element