Skip to content

feat: add QUERY method routing#3801

Open
yunz-dev wants to merge 2 commits into
tokio-rs:mainfrom
yunz-dev:main
Open

feat: add QUERY method routing#3801
yunz-dev wants to merge 2 commits into
tokio-rs:mainfrom
yunz-dev:main

Conversation

@yunz-dev

@yunz-dev yunz-dev commented Jun 17, 2026

Copy link
Copy Markdown

Add MethodFilter::QUERY, routing::query[_service] and MethodRouter::query[_service] and RouterExt::typed_query

Motivation

Recently the RFC 10008 standardized the HTTP QUERY method, which is also registered at the IANA HTTP Method Registry. In short, this new method is a mix of GET and POST method: it's safe and idempotent like GET but also has a body like POST.

Solution

It's already supported in http (hyperium/http#798) but I don't think that it's been released yet, so you can develop against the git version or wait for a release. #3799 (comment)

While developing I put this in the root Config.toml

[patch.crates-io]
http = { git = "https://github.com/hyperium/http.git" }

yunz-dev added 2 commits June 18, 2026 00:00
Add `MethodFilter::QUERY`, `routing::query[_service]` and `MethodRouter::query[_service]`
@yunz-dev

Copy link
Copy Markdown
Author

CI will fail until hyperium/http#798 in release

pub const TRACE: Self = Self::from_bits(0b1_0000_0000);
pub const TRACE: Self = Self::from_bits(0b01_0000_0000);
/// Match `QUERY` requests.
pub const QUERY: Self = Self::from_bits(0b10_0000_0000);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure if the bit mask is meant to follow a certain protocol or it doesn’t matter.

@aabolfazl

Copy link
Copy Markdown

I'like to add more sections of RFC if not implemented 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.

Support for the HTTP QUERY Method

2 participants