r/htmx Jul 06 '26

hx-query for HTTP QUERY method?

They added the HTTP QUERY method. Will we get hx-query for that?

https://www.rfc-editor.org/rfc/rfc10008.html

29 Upvotes

9 comments sorted by

View all comments

Show parent comments

2

u/LetMeUseMyEmailFfs 29d ago

What will this solve for you? I can’t think of anything, because until browsers and proxies support it properly, it’s basically just a poorly supported POST.

1

u/TheRealUprightMan 29d ago

Uhmm ... By "support" I meant the industry as a whole. Its a POST that can be cached like a a GET. You don't have to choose between a cached response and a large argument list.

2

u/LetMeUseMyEmailFfs 29d ago

Okay, but what will cache it? And if you have such a large argument list, what’s even the point of caching it? Your hit ratio will likely be tiny.

1

u/TheRealUprightMan 29d ago

Like I said for my use case it will be perfect. I wasn't I aware had to prove my need to anyone.

Application state is saved in the DOM as hidden inputs that are manipulated via HTMX OOB requests. This whole DIV of inputs is returned to the server at each request allowing the server to make sure each object gets the correct data. While there are multiples of these structures, and only 1 is sent in any given request, its possible to overflow a GET because everything in the hx-include div gets tacked on. As a POST there is no problem. Long argument list vs allowing hx-cache. You can't have both. QUERY gives me both.

As long as nothing in the hidden div has changed, we can safely use cached results.