Add support for HTTP QUERY method#309
Conversation
rhenium
left a comment
There was a problem hiding this comment.
Could you add it to IDEMPOTENT_METHODS_ so that requests can be retried?
Class-level rdoc comments mention request method-specific methods. They should also updated to include the new methods for QUERY.
| # | ||
| # #<Net::HTTPOK 200 OK readbody=false> | ||
| # | ||
| def request_query(path, body, initheader = nil, &block) #:nodoc: |
There was a problem hiding this comment.
Does anyone know why request_put is undocumented (marked as :nodoc:)? This appears to have been added in a 2003 commit, but I couldn't find the context: 38840ac
We also don't have request_patch or request_delete corresponding to PATCH and DELETE methods.
Are request_<method> methods considered obsolete?
There was a problem hiding this comment.
I wonder if put should have also taken a block, but that would be out of scope of this PR.
Could they all be included in the diff, or would it be best to open two separate PRs:
- to remove the
:nodoc:for#request_putand to add support for passing a block to#put - to introduce
request_patchandrequest_delete
I'm happy to open a separate PR to make these changes based on the response to request_-prefixed methods being deprecated.
There was a problem hiding this comment.
Changes to methods unrelated to the QUERY method should be in separate PRs.
Regarding those request_<method> methods, it's unclear to me if they're deprecated and we should avoid adding new ones, or if this was an oversight and methods for PATCH, DELETE, etc. are just missing. Personally I've never used them and they seem redundant, so I suspect it's the former, but I'm not sure.
I've requested a review from @nurse (the maintainer of net/http).
|
This will close #202 |
38108cd to
0dc82a9
Compare
Closes ruby#202 As of June 2026, [RFC 10008][] is a proposed standard. From the RFC Abstract: > This specification defines the QUERY method for HTTP. A QUERY requests > that the request target process the enclosed content in a safe and > idempotent manner and then respond with the result of that processing. > This is similar to POST requests, but QUERY requests can be > automatically repeated or restarted without concern for partial state > changes. This commit proposes support for the HTTP Query method by way of the `Net::HTTP::Query` class along with the corresponding `#query` and `#request_query` methods. [RFC 10008]: https://www.rfc-editor.org/rfc/rfc10008.html
0dc82a9 to
76b11b3
Compare
rhenium
left a comment
There was a problem hiding this comment.
Changes look good to me, apart from the open question about request_query.
As of June 2026, RFC 10008 is a proposed standard.
From the RFC Abstract:
This commit proposes support for the HTTP Query method by way of the
Net::HTTP::Queryclass along with the corresponding#queryand#request_querymethods.