2 namespace TYPO3\CMS\Core\Http;
91 throw new \InvalidArgumentException(
'Body must be a string stream resource identifier, a stream resource, or a StreamInterface instance', 1436717271);
94 if (!
$body instanceof StreamInterface) {
98 if (is_string(
$uri)) {
103 throw new \InvalidArgumentException(
'Invalid URI provided; must be null, a string, or a UriInterface instance', 1436717272);
144 if (!$this->
hasHeader(
'host') && ($this->uri && $this->uri->getHost())) {
166 if (!$this->
hasHeader($header) && strtolower($header) ===
'host' && ($this->uri && $this->uri->getHost())) {
169 return parent::getHeader($header);
179 $host = $this->uri->getHost();
180 $host .= $this->uri->getPort() ?
':' . $this->uri->getPort() :
'';
202 if ($this->requestTarget !== null) {
208 $target = $this->uri->getPath();
210 if ($this->uri->getQuery()) {
211 $target .=
'?' . $this->uri->getQuery();
214 if (empty($target)) {
241 throw new \InvalidArgumentException(
'Invalid request target provided which contains whitespaces.', 1436717273);
243 $clonedObject = clone $this;
245 return $clonedObject;
255 return !empty($this->method) ? $this->method :
'GET';
275 $clonedObject = clone $this;
276 $clonedObject->method =
$method;
277 return $clonedObject;
327 $clonedObject = clone $this;
328 $clonedObject->uri =
$uri;
331 return $clonedObject;
335 return $clonedObject;
341 $host .=
':' . $uri->
getPort();
344 $clonedObject->headerNames[
'host'] =
'Host';
345 $clonedObject->headers[
'Host'] = array($host);
346 return $clonedObject;
360 throw new \InvalidArgumentException(
'Unsupported HTTP method "' . $methodAsString .
'".', 1436717274);
363 if (!in_array(
$method, $this->supportedMethods,
true)) {
364 throw new \InvalidArgumentException(
'Unsupported HTTP method "' .
$method .
'".', 1436717275);