17 use Psr\Http\Message\ResponseInterface;
18 use Psr\Http\Message\StreamInterface;
48 101 =>
'Switching Protocols',
55 203 =>
'Non-Authoritative Information',
57 205 =>
'Reset Content',
58 206 =>
'Partial Content',
59 207 =>
'Multi-Status',
60 208 =>
'Already Reported',
63 300 =>
'Multiple Choices',
64 301 =>
'Moved Permanently',
67 304 =>
'Not Modified',
69 306 =>
'Switch Proxy',
70 307 =>
'Temporary Redirect',
71 308 =>
'Permanent Redirect',
74 401 =>
'Unauthorized',
75 402 =>
'Payment Required',
78 405 =>
'Method Not Allowed',
79 406 =>
'Not Acceptable',
80 407 =>
'Proxy Authentication Required',
81 408 =>
'Request Timeout',
84 411 =>
'Length Required',
85 412 =>
'Precondition Failed',
86 413 =>
'Payload Too Large',
87 414 =>
'URI Too Long',
88 415 =>
'Unsupported Media Type',
89 416 =>
'Range Not Satisfiable',
90 417 =>
'Expectation Failed',
91 418 =>
'I\'m a teapot',
92 421 =>
'Misdirected Request',
93 422 =>
'Unprocessable Entity',
95 424 =>
'Failed Dependency',
96 425 =>
'Unordered Collection',
97 426 =>
'Upgrade Required',
98 428 =>
'Precondition Required',
99 429 =>
'Too Many Requests',
100 431 =>
'Request Header Fields Too Large',
101 451 =>
'Unavailable For Legal Reasons',
103 500 =>
'Internal Server Error',
104 501 =>
'Not Implemented',
105 502 =>
'Bad Gateway',
106 503 =>
'Service Unavailable',
107 504 =>
'Gateway Timeout',
108 505 =>
'HTTP Version Not Supported',
109 506 =>
'Variant Also Negotiates',
110 507 =>
'Insufficient Storage',
111 508 =>
'Loop Detected',
112 509 =>
'Bandwidth Limit Exceeded',
113 510 =>
'Not Extended',
114 511 =>
'Network Authentication Required'
128 if (!is_string(
$body) && !is_resource(
$body) && !
$body instanceof StreamInterface) {
129 throw new \InvalidArgumentException(
'Body must be a string stream resource identifier, a stream resource, or a StreamInterface instance', 1436717277);
132 if (!
$body instanceof StreamInterface) {
137 if (\
TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger(
$statusCode) ===
false || !array_key_exists((
int)
$statusCode, $this->availableStatusCodes)) {
138 throw new \InvalidArgumentException(
'The given status code is not a valid HTTP status code.', 1436717278);
184 if (\
TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($code) ===
false || !array_key_exists((
int)$code, $this->availableStatusCodes)) {
185 throw new \InvalidArgumentException(
'The given status code is not a valid HTTP status code', 1436717279);
187 $clonedObject = clone $this;
188 $clonedObject->statusCode = (int)$code;
190 return $clonedObject;