This example shows how to use hx-vals
to pass parameters to all supported HTTP verbs (doc)
<ul><lihx-get="/htmx" hx-vals='{"Name": "Anna"}'>GET</li><lihx-post="/htmx" hx-vals='{"Name": "Anna"}'>POST</li><lihx-put="/htmx" hx-vals='{"Name": "Anna"}'>PUT</li><lihx-patch="/htmx" hx-vals='{"Name": "Anna"}'>PATCH</li><lihx-delete="/htmx" hx-vals='{"Name": "Anna"}'>DELETE</li></ul>
On GET
and DELETE
, the parameters are accessible via Request.Query
. For the rest, you can access the parameters via Request.Form
.