You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[`hx-validate`](/reference/attributes/hx-validate)| Control form validation behavior |
@@ -1027,7 +1027,7 @@ Use different attributes for different operations:
1027
1027
<buttonhx-delete="/users/1">Delete User</button>
1028
1028
```
1029
1029
1030
-
Each attribute combines the URL and HTTP method.
1030
+
Each attribute combines the URL and HTTP method. Alternatively, use [`hx-action`](/reference/attributes/hx-action) and [`hx-method`](/reference/attributes/hx-method) to separate them — useful when the method is dynamic, or when you want progressive enhancement with native `action`/`method` fallback.
Copy file name to clipboardExpand all lines: www/src/content/extensions/02-hx-sse.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,16 @@ The SSE extension hooks into htmx's request pipeline. When any htmx request rece
23
23
24
24
This means **any [`hx-get`](/reference/attributes/hx-get), [`hx-post`](/reference/attributes/hx-post), etc. that returns an SSE stream will just work**, no special attributes needed beyond loading the extension.
25
25
26
+
## Request Headers
27
+
28
+
With this extension loaded, outgoing htmx requests advertise SSE support:
29
+
30
+
```http
31
+
Accept: text/html, text/event-stream
32
+
```
33
+
34
+
Core htmx requests set `Accept: text/html`. The SSE extension adds `text/event-stream` so the server can return an SSE stream for any htmx request.
35
+
26
36
## `hx-sse:connect`
27
37
28
38
For persistent SSE connections (auto-connect on load, reconnect on failure), use `hx-sse:connect`:
0 commit comments