HttpNoBodyStatus
API reference › PSR bridge › emitter › HttpNoBodyStatus
Defines HTTP status codes that do not allow a response body.
See also: https://datatracker.ietf.org/doc/html/rfc7231 (RFC 7231.).
| Case | Value | Description |
|---|---|---|
CONTINUE | 100 | ‘100’ Continue. |
EARLY_HINTS | 103 | ‘103’ Early Hints. |
NO_CONTENT | 204 | ‘204’ No Content. |
NOT_MODIFIED | 304 | ‘304’ Not Modified. |
PROCESSING | 102 | ‘102’ Processing (WebDAV). |
RESET_CONTENT | 205 | ‘205’ Reset Content. |
SWITCHING_PROTOCOLS | 101 | ‘101’ Switching Protocols. |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
shouldHaveNoBody() static | Returns whether the status code should not include a body. | HttpNoBodyStatus |
Method details
Section titled “Method details”shouldHaveNoBody()
Section titled “shouldHaveNoBody() ”public static function shouldHaveNoBody(int $statusCode): boolReturns whether the status code should not include a body.
Parameters
| Parameter | Type | Description |
|---|---|---|
$statusCode | int | HTTP status code to check. |
Returns
bool: true when the status code must not carry a body; false otherwise.