HttpMethod
The typed HTTP-verb vocabulary. Replaces every stringly-typed method ('GET', 'GET|POST', the 'ALL' magic string): routes, the `#[Route]` attribute, and match results all speak this enum, never a raw string. A zero-dependency primitive at the package root because every routing type uses it.
HttpMethod::isSafe()
public function isSafe(): boolWhether the method is "safe" — read-only, with no expected server state change (RFC 9110): GET, HEAD, OPTIONS and TRACE.
HttpMethod::isIdempotent()
public function isIdempotent(): boolWhether repeating the request has the same effect as making it once (RFC 9110): every safe method, plus PUT and DELETE.
HttpMethod::cases()
public static function cases(): arrayHttpMethod::from()
public static function from(string|int $value): staticParameters
| Name | Type | Description |
|---|---|---|
| $value | string|int |
HttpMethod::tryFrom()
public static function tryFrom(string|int $value): ?staticParameters
| Name | Type | Description |
|---|---|---|
| $value | string|int |