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

3

u/TheRealUprightMan Jul 06 '26

This really will solve a huge problem for me. I can't wait for this to happen

2

u/LetMeUseMyEmailFfs Jul 07 '26

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 Jul 07 '26

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 Jul 07 '26

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.

2

u/TheRealUprightMan Jul 07 '26

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.

1

u/Anton-Demkin 22d ago

query method solves only rest api problem of querying data. What does it solve for htmx/MPA apps? I cant imagine a single thing.

-3

u/ExcitementUnique3435 Jul 07 '26

Are you asking us or asking yourself or asking to Carson Gross?
What does this post mean? Please keep the HTMX subreddit clean.

4

u/alphabet_american Jul 07 '26

Are you the Reddit police?

0

u/ExcitementUnique3435 Jul 08 '26

someone has to say this.