Skip to content
PHP Ecosystem
Explore

HttpNoBodyStatus

API reference › PSR bridge › emitter › HttpNoBodyStatus

enumyii2\extensions\psrbridge\emitter\HttpNoBodyStatus
Backed byint
Sourcesrc/emitter/HttpNoBodyStatus.php

Defines HTTP status codes that do not allow a response body.

See also: https://datatracker.ietf.org/doc/html/rfc7231 (RFC 7231.).

CaseValueDescription
CONTINUE100‘100’ Continue.
EARLY_HINTS103‘103’ Early Hints.
NO_CONTENT204‘204’ No Content.
NOT_MODIFIED304‘304’ Not Modified.
PROCESSING102‘102’ Processing (WebDAV).
RESET_CONTENT205‘205’ Reset Content.
SWITCHING_PROTOCOLS101‘101’ Switching Protocols.
MethodDescriptionDefined by
shouldHaveNoBody() staticReturns whether the status code should not include a body.HttpNoBodyStatus
public static function shouldHaveNoBody(int $statusCode): bool

Returns whether the status code should not include a body.

Parameters

ParameterTypeDescription
$statusCodeintHTTP status code to check.

Returns

bool: true when the status code must not carry a body; false otherwise.