Skip to content

Feat/query - #88

Merged
NEFORCEO merged 23 commits into
masterfrom
feat/query
Jul 14, 2026
Merged

Feat/query#88
NEFORCEO merged 23 commits into
masterfrom
feat/query

Conversation

@NEFORCEO

Copy link
Copy Markdown
Member

🚀 Description

Adds support for the QUERY HTTP method — a newer method proposed in an IETF draft (draft-ietf-httpbis-safe-method-w-body) that is safe and idempotent like GET, but carries a request body like POST. Useful for complex search/filter reads that don't fit cleanly in a URL.

QUERY is now wired through every layer that already understood the standard method set:

  • fasthttp/types.py"QUERY" added to the HTTPMethod literal.
  • fasthttp/routing.pyRouter.query() decorator (accepts json/data/files, like post()).
  • fasthttp/app.pyFastHTTP.query() decorator + query_request constructor option, mirroring get_request/post_request.
  • fasthttp/session.pyAsyncSession.query() + QUERY added to the per-method request-config table (so session-level headers/timeout apply correctly).
  • fasthttp/client.py — request body is now forwarded on 307/308 redirects for QUERY, same as POST/PUT/PATCH.
  • fasthttp/openapi/routes.py — Swagger "Try it out" proxy forwards a body for QUERY requests.
  • fasthttp/helpers/route_inspect.pycreate_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

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation update
  • refactor: Code refactoring
  • ci: CI/CD changes
  • chore: Maintenance

✅ Checklist

  • Tests added or updated
  • Documentation updated
  • No breaking changes
  • Code follows project style

🔗 Related Issues

Fixes #


📸 Additional Context

Docs: updated README.md, docs/en and docs/rututorial/http-methods.md (new QUERY section), reference/fasthttp.md, and the legacy api-reference.md — plus every place that listed the method set (index.md, tutorial/index.md). No mkdocs.yml nav changes were needed since no new pages were added; mkdocs build --strict (via uv run) passes clean.

Known limitation: QUERY is 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 stock swagger-ui-dist bundle, which only recognizes the standard method keys. This is documented as a caveat in the tutorial page.

Out of scope: the fasthttp CLI (fasthttp/cli/) was intentionally left untouched — its command surface is hardcoded to get/post/put/patch/delete and adding a query subcommand felt like a separate change.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for your contribution, @NEFORCEO!

Please make sure:

  • Code is clean and formatted
  • Tests are passing
  • PR description is clear

Maintainers will review it soon.

@fasthttp-bot fasthttp-bot added tests dependencies Pull requests that update a dependency file feature labels Jul 14, 2026
@codspeed-hq

codspeed-hq Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will improve performance by 41.48%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 6 improved benchmarks
✅ 6 untouched benchmarks

Performance Changes

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

Open in CodSpeed

Footnotes

  1. No successful run was found on master (a973b79) during the generation of this report, so 6f3d441 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@NEFORCEO
NEFORCEO merged commit 41d2cd0 into master Jul 14, 2026
17 checks passed
@NEFORCEO
NEFORCEO deleted the feat/query branch July 14, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file feature tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants