mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-30 06:21:19 +00:00
33 lines
729 B
Markdown
33 lines
729 B
Markdown
---
|
|
layout: layout.njk
|
|
title: </> htmx - hx-request
|
|
---
|
|
|
|
## `hx-request`
|
|
|
|
The `hx-request` attribute allows you to configure various aspects of the request via the following attributes:
|
|
|
|
* `timeout` - the timeout for the request, in milliseconds
|
|
* `credentials` - if the request will send credentials
|
|
* `noHeaders` - strips all headers from the request
|
|
|
|
These attributes are set using a JSON-like syntax:
|
|
|
|
```html
|
|
<div ... hx-request='\"timeout\":100'>
|
|
...
|
|
</div>
|
|
```
|
|
|
|
You may make the values dynamically evaluated by adding the `javascript:` or `js:` prefix:
|
|
|
|
```html
|
|
<div ... hx-request='js: timeout:getTimeoutSetting() '>
|
|
...
|
|
</div>
|
|
```
|
|
|
|
### Notes
|
|
|
|
* `hx-request` is merge-inherited and can be placed on a parent element
|