IResponse
interface IResponse
HTTP response interface.
Constants
S100_Continue |
HTTP 1.1 response code |
S101_SwitchingProtocols |
HTTP 1.1 response code |
S102_Processing |
HTTP 1.1 response code |
S200_OK |
HTTP 1.1 response code |
S201_Created |
HTTP 1.1 response code |
S202_Accepted |
HTTP 1.1 response code |
S203_NonAuthoritativeInformation |
HTTP 1.1 response code |
S204_NoContent |
HTTP 1.1 response code |
S205_ResetContent |
HTTP 1.1 response code |
S206_PartialContent |
HTTP 1.1 response code |
S207_MultiStatus |
HTTP 1.1 response code |
S208_AlreadyReported |
HTTP 1.1 response code |
S226_ImUsed |
HTTP 1.1 response code |
S300_MultipleChoices |
HTTP 1.1 response code |
S301_MovedPermanently |
HTTP 1.1 response code |
S302_Found |
HTTP 1.1 response code |
S303_PostGet |
HTTP 1.1 response code |
S304_NotModified |
HTTP 1.1 response code |
S305_UseProxy |
HTTP 1.1 response code |
S307_TemporaryRedirect |
HTTP 1.1 response code |
S308_PermanentRedirect |
HTTP 1.1 response code |
S400_BadRequest |
HTTP 1.1 response code |
S401_Unauthorized |
HTTP 1.1 response code |
S402_PaymentRequired |
HTTP 1.1 response code |
S403_Forbidden |
HTTP 1.1 response code |
S404_NotFound |
HTTP 1.1 response code |
S405_MethodNotAllowed |
HTTP 1.1 response code |
S406_NotAcceptable |
HTTP 1.1 response code |
S407_ProxyAuthenticationRequired |
HTTP 1.1 response code |
S408_RequestTimeout |
HTTP 1.1 response code |
S409_Conflict |
HTTP 1.1 response code |
S410_Gone |
HTTP 1.1 response code |
S411_LengthRequired |
HTTP 1.1 response code |
S412_PreconditionFailed |
HTTP 1.1 response code |
S413_RequestEntityTooLarge |
HTTP 1.1 response code |
S414_RequestUriTooLong |
HTTP 1.1 response code |
S415_UnsupportedMediaType |
HTTP 1.1 response code |
S416_RequestedRangeNotSatisfiable |
HTTP 1.1 response code |
S417_ExpectationFailed |
HTTP 1.1 response code |
S421_MisdirectedRequest |
HTTP 1.1 response code |
S422_UnprocessableEntity |
HTTP 1.1 response code |
S423_Locked |
HTTP 1.1 response code |
S424_FailedDependency |
HTTP 1.1 response code |
S426_UpgradeRequired |
HTTP 1.1 response code |
S428_PreconditionRequired |
HTTP 1.1 response code |
S429_TooManyRequests |
HTTP 1.1 response code |
S431_RequestHeaderFieldsTooLarge |
HTTP 1.1 response code |
S451_UnavailableForLegalReasons |
HTTP 1.1 response code |
S500_InternalServerError |
HTTP 1.1 response code |
S501_NotImplemented |
HTTP 1.1 response code |
S502_BadGateway |
HTTP 1.1 response code |
S503_ServiceUnavailable |
HTTP 1.1 response code |
S504_GatewayTimeout |
HTTP 1.1 response code |
S505_HttpVersionNotSupported |
HTTP 1.1 response code |
S506_VariantAlsoNegotiates |
HTTP 1.1 response code |
S507_InsufficientStorage |
HTTP 1.1 response code |
S508_LoopDetected |
HTTP 1.1 response code |
S510_NotExtended |
HTTP 1.1 response code |
S511_NetworkAuthenticationRequired |
HTTP 1.1 response code |
ReasonPhrases |
|
SameSiteLax |
SameSite cookie |
SameSiteStrict |
SameSite cookie |
SameSiteNone |
SameSite cookie |
deprecated REASON_PHRASES |
|
deprecated SAME_SITE_LAX |
|
deprecated SAME_SITE_STRICT |
|
deprecated SAME_SITE_NONE |
|
deprecated S100_CONTINUE |
|
deprecated S101_SWITCHING_PROTOCOLS |
|
deprecated S102_PROCESSING |
|
deprecated S201_CREATED |
|
deprecated S202_ACCEPTED |
|
deprecated S203_NON_AUTHORITATIVE_INFORMATION |
|
deprecated S204_NO_CONTENT |
|
deprecated S205_RESET_CONTENT |
|
deprecated S206_PARTIAL_CONTENT |
|
deprecated S207_MULTI_STATUS |
|
deprecated S208_ALREADY_REPORTED |
|
deprecated S226_IM_USED |
|
deprecated S300_MULTIPLE_CHOICES |
|
deprecated S301_MOVED_PERMANENTLY |
|
deprecated S302_FOUND |
|
deprecated S303_SEE_OTHER |
|
deprecated S303_POST_GET |
|
deprecated S304_NOT_MODIFIED |
|
deprecated S305_USE_PROXY |
|
deprecated S307_TEMPORARY_REDIRECT |
|
deprecated S308_PERMANENT_REDIRECT |
|
deprecated S400_BAD_REQUEST |
|
deprecated S401_UNAUTHORIZED |
|
deprecated S402_PAYMENT_REQUIRED |
|
deprecated S403_FORBIDDEN |
|
deprecated S404_NOT_FOUND |
|
deprecated S405_METHOD_NOT_ALLOWED |
|
deprecated S406_NOT_ACCEPTABLE |
|
deprecated S407_PROXY_AUTHENTICATION_REQUIRED |
|
deprecated S408_REQUEST_TIMEOUT |
|
deprecated S409_CONFLICT |
|
deprecated S410_GONE |
|
deprecated S411_LENGTH_REQUIRED |
|
deprecated S412_PRECONDITION_FAILED |
|
deprecated S413_REQUEST_ENTITY_TOO_LARGE |
|
deprecated S414_REQUEST_URI_TOO_LONG |
|
deprecated S415_UNSUPPORTED_MEDIA_TYPE |
|
deprecated S416_REQUESTED_RANGE_NOT_SATISFIABLE |
|
deprecated S417_EXPECTATION_FAILED |
|
deprecated S421_MISDIRECTED_REQUEST |
|
deprecated S422_UNPROCESSABLE_ENTITY |
|
deprecated S423_LOCKED |
|
deprecated S424_FAILED_DEPENDENCY |
|
deprecated S426_UPGRADE_REQUIRED |
|
deprecated S428_PRECONDITION_REQUIRED |
|
deprecated S429_TOO_MANY_REQUESTS |
|
deprecated S431_REQUEST_HEADER_FIELDS_TOO_LARGE |
|
deprecated S451_UNAVAILABLE_FOR_LEGAL_REASONS |
|
deprecated S500_INTERNAL_SERVER_ERROR |
|
deprecated S501_NOT_IMPLEMENTED |
|
deprecated S502_BAD_GATEWAY |
|
deprecated S503_SERVICE_UNAVAILABLE |
|
deprecated S504_GATEWAY_TIMEOUT |
|
deprecated S505_HTTP_VERSION_NOT_SUPPORTED |
|
deprecated S506_VARIANT_ALSO_NEGOTIATES |
|
deprecated S507_INSUFFICIENT_STORAGE |
|
deprecated S508_LOOP_DETECTED |
|
deprecated S510_NOT_EXTENDED |
|
deprecated S511_NETWORK_AUTHENTICATION_REQUIRED |
|
Methods
Returns HTTP response code.
Sends a Content-type HTTP header.
Redirects to a new URL.
Sets the time (like '20 minutes') before a page cached on a browser expires, null means "must-revalidate".
Checks if headers have been sent.
Returns value of an HTTP header.
Returns an associative array of headers to sent.
Sends a cookie.
Deletes a cookie.
No description
Details
at line 342
IResponse
setCode(int $code, string|null $reason = null)
Sets HTTP response code.
at line 347
int
getCode()
Returns HTTP response code.
at line 353
IResponse
setHeader(string $name, string $value)
Sends a HTTP header and replaces a previous one.
at line 359
IResponse
addHeader(string $name, string $value)
Adds HTTP header.
at line 365
IResponse
setContentType(string $type, string|null $charset = null)
Sends a Content-type HTTP header.
at line 370
void
redirect(string $url, int $code = self::S302_Found)
Redirects to a new URL.
at line 376
IResponse
setExpiration(string|null $expire)
Sets the time (like '20 minutes') before a page cached on a browser expires, null means "must-revalidate".
at line 381
bool
isSent()
Checks if headers have been sent.
at line 386
string|null
getHeader(string $header)
Returns value of an HTTP header.
at line 391
array
getHeaders()
Returns an associative array of headers to sent.
at line 397
IResponse
setCookie(string $name, string $value, int|null $expire, string|null $path = null, string|null $domain = null, bool|null $secure = null, bool|null $httpOnly = null)
Sends a cookie.
at line 410
deleteCookie(string $name, string|null $path = null, string|null $domain = null, bool|null $secure = null)
Deletes a cookie.
at line 17
self
deleteHeader(string $name)
No description