✨ Add query and queryUri for the HTTP QUERY method (RFC 10008)#2557
Conversation
The QUERY method is safe and idempotent like GET, but allows a request body, which is useful for complex queries that do not fit in the URL. Closes cfug#2548 Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
The PR title and description cite RFC 9239, but that RFC is actually Updates to ECMAScript Media Types (defining The correct reference is RFC 10008, published 2026-06-15 on the IETF Standards Track (Proposed Standard). The code, CHANGELOG, and README in this PR already cite 10008 correctly — only the PR title and description need to be updated to match. FYI: Proposed Standard is the first formal stage of the IETF standards process (the same status HTTP/2 RFC 7540 and HTTP/3 RFC 9114 had at initial publication), not an Internet-Draft — so the adaptation itself is legitimate. |
query and queryUri for the HTTP QUERY method (RFC 9239)query and queryUri for the HTTP QUERY method (RFC 10008)
| /// | ||
| /// The QUERY method is defined in [RFC 10008][]. Unlike GET, it allows a | ||
| /// request body, and unlike POST, it is safe and idempotent. It is intended | ||
| /// for complex queries whose parameters are too large or too structured to | ||
| /// fit in the request URI. | ||
| /// | ||
| /// [RFC 10008]: https://www.rfc-editor.org/rfc/rfc10008 |
There was a problem hiding this comment.
The method doesn't need this full comment because we also enable the request payload for GET in dio. Align with others. The same goes for queryUri.
Per review feedback, the QUERY method does not need a full description here since dio also enables request payloads for GET. Trim the comments to match the single-line style used by `get`/`post`/`put`/etc. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Done. The doc comments on |
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is |
Summary
Dio.queryandDio.queryUriconvenience methods for the HTTP QUERY method defined in RFC 10008.GET, but allows a request body, which is useful for complex queries whose parameters are too large or too structured to fit in the request URI.get/post/put/patch/delete/headconvenience methods and delegate torequest/requestUriwithcheckOptions('QUERY', options). No existing public API is changed, and all adapters already pass the method string through (HttpClient.openUrlon native,XMLHttpRequest.openon Web), so no adapter changes are required.CHANGELOG.md,README.md, andREADME-ZH.md.Closes #2548
Verification
melos run format— passmelos run analyze— passdart test test/test_suite_test.dart(dio, VM) — the two newQUERYtests pass, along with the rest of theHTTP methodgroup. A few pre-existing failures inbasic_testsandtimeout_testsare environment-specific (DNS resolution / TLS handshake / download throughput on the local machine) and unrelated to this change.AI attribution
Implementation, tests, and docs by Devin (GLM-5.2).
Generated with Devin