system/CodeIgniter.php
protected function getRequestObject()
	{
		if ($this->request instanceof Request)
		{
			return;
		}

		if (is_cli() && ! (ENVIRONMENT === 'testing'))
		{
			$this->request = Services::clirequest($this->config);
		}
		else
		{
			$this->request = Services::request($this->config);
			// guess at protocol if needed
			$this->request->setProtocolVersion($_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1');
		}
	}
protected function getRequestObject()
	{
		if ($this->request instanceof Request)
		{
			return;
		}

		if (is_cli() && ! (ENVIRONMENT === 'testing'))
		{
			$this->request = Services::clirequest($this->config);
		}
		else
		{
			$this->request = Services::request($this->config);
			// guess at protocol if needed
			$this->request->setProtocolVersion($_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1');
		}
	}
Get our Request object, (either IncomingRequest or CLIRequest)
and set the server protocol based on the information provided
by the server.