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

…erb. Update documentation and tests to reflect this new feature. Also, include a new entry in the CHANGELOG for version 1.8.9.
@psolvy psolvy force-pushed the add-query-method branch from fd379db to 214343e Compare June 25, 2026 08:21
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