Skip to content

feat(routing): support the HTTP QUERY method - #3837

Closed
farrosfr wants to merge 2 commits into
tokio-rs:mainfrom
farrosfr:feature/http-query-method
Closed

feat(routing): support the HTTP QUERY method#3837
farrosfr wants to merge 2 commits into
tokio-rs:mainfrom
farrosfr:feature/http-query-method

Conversation

@farrosfr

Copy link
Copy Markdown
Contributor

feat(routing): support HTTP QUERY method (RFC 10008)

Resolves #3799.

Overview

Adds routing filters, handlers, and typed routing support for the newly standardized HTTP QUERY method (RFC 10008).

Changes

axum

  • MethodFilter::QUERY: Defined a new bitflag (0b10_0000_0000).
  • TryFrom<Method> for MethodFilter: Added fallback matching (other if other.as_str() == "QUERY").
  • MethodRouter:
    • Added query: MethodEndpoint<S, E> field.
    • Added top-level query and query_service functions.
    • Added chained .query(handler) and .query_service(service) methods.
    • Updated the internal call! macro to match "QUERY" string slices for routing.
  • Testing: Added a generic .request(method, url) to the test client and an integration test verifying that QUERY requests route to the query handler.

axum-extra

  • RouterExt::typed_query: Implemented typed routing support for QUERY requests on TypedPath.

Compatibility Notes

Because the http crate has not yet released a new version containing Method::QUERY, the implementation uses string comparisons (req.method().as_str() == "QUERY"). This compiles on current stable dependencies and remains forward-compatible.

farrosfr added 2 commits July 20, 2026 12:20
Add MethodFilter::QUERY and corresponding routing helpers query and
query_service to allow handling requests using the standardized
HTTP QUERY method (RFC 10008).

Refs: tokio-rs#3799
@farrosfr farrosfr mentioned this pull request Jul 20, 2026
1 task
@mladedav

Copy link
Copy Markdown
Collaborator

There's already #3801 which waits for upstream http release. I'd rather we already use the newer http::Method with the method than to compare strings here.

You can check that PR and discuss there if you think anything else is missing in the implementation.

@mladedav mladedav closed this Jul 20, 2026
@farrosfr

Copy link
Copy Markdown
Contributor Author

Thanks @mladedav I am sorry because I didn't check for existing open PRs before submitting.

Okay i will check if there is any need for implementation in that PR.

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.

Support for the HTTP QUERY Method

2 participants