Skip to content

Commit

Permalink
http non-breaking: add the draft Method::Query
Browse files Browse the repository at this point in the history
  • Loading branch information
jbr committed Aug 15, 2023
1 parent 7820a0c commit ad283c1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions http/src/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,17 @@ pub enum Method {
/// [RFC7231, Section 4.3.4]: https://tools.ietf.org/html/rfc7231#section-4.3.4
Put,

/// The QUERY method is used to initiate a server-side query. Unlike the HTTP GET method, which
/// requests that a server return a representation of the resource identified by the target URI,
/// the QUERY method is used to ask the server to perform a query operation (described by the
/// request payload) over some set of data scoped to the effective request URI. See
/// [draft-ietf-httpbis-safe-method-w-body-03][]
///
/// NOTE: As of January 2023, this draft has expired.
///
/// [draft-ietf-httpbis-safe-method-w-body-03]: https://www.ietf.org/archive/id/draft-ietf-httpbis-safe-method-w-body-03.html
Query,

/// The REBIND method removes a binding to a resource from a collection, and adds a binding to
/// that resource into the collection identified by the Request-URI.
///
Expand Down Expand Up @@ -358,6 +369,7 @@ impl Method {
| Method::Options
| Method::Pri
| Method::PropFind
| Method::Query
| Method::Report
| Method::Search
| Method::Trace
Expand Down Expand Up @@ -406,6 +418,7 @@ impl Method {
Self::PropFind => "PROPFIND",
Self::PropPatch => "PROPPATCH",
Self::Put => "PUT",
Self::Query => "QUERY",
Self::Rebind => "REBIND",
Self::Report => "REPORT",
Self::Search => "SEARCH",
Expand Down Expand Up @@ -460,6 +473,7 @@ impl FromStr for Method {
"PROPFIND" => Ok(Self::PropFind),
"PROPPATCH" => Ok(Self::PropPatch),
"PUT" => Ok(Self::Put),
"QUERY" => Ok(Self::Query),
"REBIND" => Ok(Self::Rebind),
"REPORT" => Ok(Self::Report),
"SEARCH" => Ok(Self::Search),
Expand Down Expand Up @@ -528,6 +542,7 @@ mod test {
"PROPFIND",
"PROPPATCH",
"PUT",
"QUERY",
"REBIND",
"REPORT",
"SEARCH",
Expand Down

0 comments on commit ad283c1

Please sign in to comment.