Skip to content

Add support for the HTTP QUERY method (RFC 10008)#6737

Open
psolvy wants to merge 1 commit into
phoenixframework:mainfrom
psolvy:add-query-method
Open

Add support for the HTTP QUERY method (RFC 10008)#6737
psolvy wants to merge 1 commit into
phoenixframework:mainfrom
psolvy:add-query-method

Conversation

@psolvy

@psolvy psolvy commented Jun 25, 2026

Copy link
Copy Markdown

Summary

Adds support for the new HTTP QUERY method, standardized in RFC 10008 (Proposed Standard, June 2026).

QUERY is safe and idempotent like GET, but carries a request body like POST — the request content (of any media type) defines the query. Because it is idempotent, a QUERY can be safely retried, unlike POST.

Changes

  • Phoenix.Router — add :query to the supported HTTP verbs, generating the query/3 and query/4 route macros (mirroring get, post, etc.). Routing arbitrary verbs already worked via match; this adds the ergonomic, discoverable verb macro.
  • Phoenix.ConnTest — add the matching query/3 test helper, for parity with the other verbs.
  • guides/routing.md — document QUERY among the supported HTTP verbs.
  • mix.exs — raise the minimum Plug requirement to ~> 1.21, the release that parses QUERY request bodies into conn.body_params and treats QUERY as a safe method in Plug.CSRFProtection (Add support for the HTTP QUERY method (RFC 10008) elixir-plug/plug#1319). Because this raises a dependency floor and adds a new public macro, the CHANGELOG targets a 1.9.0 (minor) release.

References

@SteffenDE

Copy link
Copy Markdown
Member

I assume we need to wait for an updated plug and then bump the minimum plug version?

@psolvy psolvy force-pushed the add-query-method branch from cd6d196 to fd379db Compare June 25, 2026 08:03
@psolvy

psolvy commented Jun 25, 2026

Copy link
Copy Markdown
Author

@SteffenDE hello!
Yes - you are right. I have already opened a Plug library PR to support a new method
elixir-plug/plug#1319

UPD updated this one with a minimum Plug version and bumped phoenix minor version instead of fix one

@psolvy psolvy force-pushed the add-query-method branch from fd379db to 214343e Compare June 25, 2026 08:21
@SteffenDE

Copy link
Copy Markdown
Member

@psolvy please update again, we moved main to 1.9 now, so the changelog has a conflict :)

@josevalim current Plug still allows Elixir 1.15, so if we want to backport, do you see a reason we can't require plug 1.21 for Phoenix 1.8?

@psolvy psolvy force-pushed the add-query-method branch from 214343e to b58cb03 Compare July 3, 2026 13:24
@psolvy

psolvy commented Jul 3, 2026

Copy link
Copy Markdown
Author

@SteffenDE done!

PS as i can see query changes are in the 1.21.0-dev right now, not in the 1.21.0

elixir-plug/plug@e64e37c

@SteffenDE

Copy link
Copy Markdown
Member

Perfect, thank you. Yes, Plug 1.21 is not out yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants