Feat/query - #88
Merged
Merged
Conversation
Contributor
|
👋 Thanks for your contribution, @NEFORCEO! Please make sure:
Maintainers will review it soon. |
Contributor
Merging this PR will improve performance by 41.48%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | test_response_req_text_from_json |
213.2 µs | 134.6 µs | +58.4% |
| ⚡ | test_response_repr |
196.4 µs | 133.9 µs | +46.68% |
| ⚡ | test_response_property_access |
194.5 µs | 133.5 µs | +45.7% |
| ⚡ | test_response_creation |
201.3 µs | 139.3 µs | +44.47% |
| ⚡ | test_response_json_parsing |
205.6 µs | 143.2 µs | +43.53% |
| ⚡ | test_middleware_after_response |
403.1 µs | 352.8 µs | +14.27% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing feat/query (b9b0333) with master (6f3d441)1
Footnotes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Description
Adds support for the
QUERYHTTP method — a newer method proposed in an IETF draft (draft-ietf-httpbis-safe-method-w-body) that is safe and idempotent likeGET, but carries a request body likePOST. Useful for complex search/filter reads that don't fit cleanly in a URL.QUERYis now wired through every layer that already understood the standard method set:fasthttp/types.py—"QUERY"added to theHTTPMethodliteral.fasthttp/routing.py—Router.query()decorator (acceptsjson/data/files, likepost()).fasthttp/app.py—FastHTTP.query()decorator +query_requestconstructor option, mirroringget_request/post_request.fasthttp/session.py—AsyncSession.query()+QUERYadded to the per-method request-config table (so session-level headers/timeout apply correctly).fasthttp/client.py— request body is now forwarded on307/308redirects forQUERY, same asPOST/PUT/PATCH.fasthttp/openapi/routes.py— Swagger "Try it out" proxy forwards a body forQUERYrequests.fasthttp/helpers/route_inspect.py—create_route_params()literal extended.httpx(the transport underneath) already accepts arbitrary method strings, so no changes were needed in the Rust core.🧩 Type of Change
✅ Checklist
🔗 Related Issues
Fixes #
📸 Additional Context
Docs: updated
README.md,docs/enanddocs/ru—tutorial/http-methods.md(newQUERYsection),reference/fasthttp.md, and the legacyapi-reference.md— plus every place that listed the method set (index.md,tutorial/index.md). Nomkdocs.ymlnav changes were needed since no new pages were added;mkdocs build --strict(viauv run) passes clean.Known limitation:
QUERYis not part of the standard OpenAPI Path Item Object method set (get/put/post/delete/options/head/patch/trace). Routes registered with.query()are included in the generated/openapi.json, but won't render in Swagger UI since it uses the stockswagger-ui-distbundle, which only recognizes the standard method keys. This is documented as a caveat in the tutorial page.Out of scope: the
fasthttpCLI (fasthttp/cli/) was intentionally left untouched — its command surface is hardcoded toget/post/put/patch/deleteand adding aquerysubcommand felt like a separate change.