- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/lib/web/http/request.php
- Класс: Bitrix\Main\Web\Http\Request
- Вызов: Request::__construct
public function __construct(string $method, UriInterface $uri, array $headers = null, StreamInterface $body = null, string $version = null)
{
parent::__construct($headers, $body, $version);
$this->method = $method;
$this->uri = $uri;
// PSR-7: During construction, implementations MUST attempt to set the Host header from a provided URI if no Host header is provided.
if ($uri->getHost() != '' && !$this->hasHeader('Host'))
{
$this->headers->set('Host', $uri->getHost());
}
}