pub enum Method {
GET,
POST,
PATCH,
PUT,
DELETE,
TRACE,
HEAD,
OPTIONS,
CONNECT,
ANY,
}Expand description
HTTP request method enumeration
Represents standard HTTP methods plus an ANY variant for wildcards.
Variants§
GET
HTTP GET method
POST
HTTP POST method
PATCH
HTTP PATCH method
PUT
HTTP PUT method
DELETE
HTTP DELETE method
TRACE
HTTP TRACE method
HEAD
HTTP HEAD method
OPTIONS
HTTP OPTIONS method
CONNECT
HTTP CONNECT method
ANY
Wildcard for any method
Implementations§
Source§impl Method
impl Method
Sourcepub fn to_http_method(&self) -> Method
pub fn to_http_method(&self) -> Method
Convert to product_os_http::Method
Converts this Method enum to the underlying HTTP library’s method type.
The ANY variant defaults to GET.
Sourcepub fn from_http_method(method: &Method) -> Method
pub fn from_http_method(method: &Method) -> Method
Create from product_os_http::Method
Converts from the underlying HTTP library’s method type to this Method enum.
Unknown methods default to ANY.
Sourcepub fn from_str(method: &str) -> Method
pub fn from_str(method: &str) -> Method
Parse from string representation
Creates a Method from its string representation.
Unknown method strings default to ANY.
Note: This method is intentionally not implementing FromStr trait
to avoid confusion with the standard library trait, as this method
returns a default value instead of an error for unknown strings.