RequestMethod

Enum
backed by string

Enum RequestMethod.

Description

Represents the set of valid HTTP request methods as defined by the IETF RFC 7231 and related specifications. This enum SHALL be used to strictly define supported request methods within HTTP client and server implementations. Each case corresponds to a standardized HTTP method, expressed as an uppercase string literal.

Implementations utilizing this enum MUST validate incoming or outgoing request methods against this set to ensure protocol compliance and interoperability.

Table of Contents

Cases

Connect

The CONNECT method establishes a tunnel to the target resource, often used with HTTPS proxies.

 = 'CONNECT'
Delete

The DELETE method removes the specified resource.

 = 'DELETE'
Get

The GET method requests a representation of the specified resource. It MUST NOT have side-effects.

 = 'GET'
Head

The HEAD method requests the headers for a given resource without the response body.

 = 'HEAD'
Options

The OPTIONS method describes the communication options for the target resource.

 = 'OPTIONS'
Patch

The PATCH method applies partial modifications to the target resource.

 = 'PATCH'
Post

The POST method submits data to be processed, often causing a change in state or side-effects.

 = 'POST'
Purge

The PURGE method requests that a cached resource be removed, often used with proxy servers.

 = 'PURGE'
Put

The PUT method replaces the target resource with the request payload.

 = 'PUT'
Trace

The TRACE method performs a message loop-back test along the path to the target resource.

 = 'TRACE'

Methods

isCacheable()

Returns true if the method is considered cacheable by default.

 : bool
isIdempotent()

Returns true if the method is idempotent (multiple identical requests have the same effect as a single one).

 : bool
isSafe()

Returns true if the method is considered safe (does not modify server state).

 : bool
Cases

Cases

Head

Case

The HEAD method requests the headers for a given resource without the response body.

Get

Case

The GET method requests a representation of the specified resource. It MUST NOT have side-effects.

Post

Case

The POST method submits data to be processed, often causing a change in state or side-effects.

Put

Case

The PUT method replaces the target resource with the request payload.

Patch

Case

The PATCH method applies partial modifications to the target resource.

Delete

Case

The DELETE method removes the specified resource.

Purge

Case

The PURGE method requests that a cached resource be removed, often used with proxy servers.

Options

Case

The OPTIONS method describes the communication options for the target resource.

Trace

Case

The TRACE method performs a message loop-back test along the path to the target resource.

Connect

Case

The CONNECT method establishes a tunnel to the target resource, often used with HTTPS proxies.

Methods

isCacheable()

Public

Returns true if the method is considered cacheable by default.

public isCacheable() : bool
Return values
bool

isIdempotent()

Public

Returns true if the method is idempotent (multiple identical requests have the same effect as a single one).

public isIdempotent() : bool
Return values
bool

isSafe()

Public

Returns true if the method is considered safe (does not modify server state).

public isSafe() : bool
Return values
bool