Skip to main content

Module method

Module method 

Source
Expand description

HTTP method types.

HttpMethod is a typed enum of all standard HTTP verbs, with as_str(), FromStr, Display, and safety/idempotency predicates.

§Example

use api_bones::method::HttpMethod;

let m = HttpMethod::Get;
assert_eq!(m.as_str(), "GET");
assert!(m.is_safe());
assert!(m.is_idempotent());

let m2: HttpMethod = "POST".parse().unwrap();
assert_eq!(m2, HttpMethod::Post);
assert!(!m2.is_safe());

Structs§

ParseHttpMethodError
Error returned when parsing an HttpMethod from a string fails.

Enums§

HttpMethod
Standard HTTP request methods (RFC 9110 §9).