HTTP
: string
in package
HTTP request method enum.
Represents standard HTTP verbs supported by the phpEZ API framework. Provides utilities to get the current request method and validate method types.
Tags
Table of Contents
Cases
Methods
- is() : bool
- Check if this HTTP method matches a given method or the current request method.
- method() : static
- Get the HTTP method of the current request.
Cases
GET
POST
PUT
DELETE
REPORT
Methods
is()
Check if this HTTP method matches a given method or the current request method.
public
is([string|null $meth = null ]) : bool
Usage:
if (HTTP::POST->is()) { ... } // Check if current is POST
if ($method->is(HTTP::GET->value)) { ... } // Check if $method is GET
Parameters
- $meth : string|null = null
-
Optional HTTP method value to compare against. If null, compares against the current request method.
Return values
bool —True if this method matches the given method or current request.
method()
Get the HTTP method of the current request.
public
static method() : static
Tags
Return values
static —The HTTP method enum case for the current request.