Skip to content

Commit b2f33ba

Browse files
committed
Add RequestMethod
1 parent 26ce55f commit b2f33ba

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

src/RequestMethod.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
namespace FastForward\Http\Message;
4+
5+
/**
6+
* Enum RequestMethod
7+
*
8+
* Represents the set of valid HTTP request methods as defined by the IETF RFC 7231 and related specifications.
9+
* This enum SHALL be used to strictly define supported request methods within HTTP client and server implementations.
10+
* Each case corresponds to a standardized HTTP method, expressed as an uppercase string literal.
11+
*
12+
* Implementations utilizing this enum MUST validate incoming or outgoing request methods against this set to ensure
13+
* protocol compliance and interoperability.
14+
*
15+
* @package FastForward\Http\Message
16+
*/
17+
enum RequestMethod: string
18+
{
19+
/** @var string The HEAD method requests the headers for a given resource without the response body. */
20+
case HEAD = 'HEAD';
21+
22+
/** @var string The GET method requests a representation of the specified resource. It MUST NOT have side-effects. */
23+
case GET = 'GET';
24+
25+
/** @var string The POST method submits data to be processed, often causing a change in state or side-effects. */
26+
case POST = 'POST';
27+
28+
/** @var string The PUT method replaces the target resource with the request payload. */
29+
case PUT = 'PUT';
30+
31+
/** @var string The PATCH method applies partial modifications to the target resource. */
32+
case PATCH = 'PATCH';
33+
34+
/** @var string The DELETE method removes the specified resource. */
35+
case DELETE = 'DELETE';
36+
37+
/** @var string The PURGE method requests that a cached resource be removed, often used with proxy servers. */
38+
case PURGE = 'PURGE';
39+
40+
/** @var string The OPTIONS method describes the communication options for the target resource. */
41+
case OPTIONS = 'OPTIONS';
42+
43+
/** @var string The TRACE method performs a message loop-back test along the path to the target resource. */
44+
case TRACE = 'TRACE';
45+
46+
/** @var string The CONNECT method establishes a tunnel to the target resource, often used with HTTPS proxies. */
47+
case CONNECT = 'CONNECT';
48+
}

0 commit comments

Comments
 (0)