public function setScheme(string $scheme) : Request
    {
        $scheme = strtolower($scheme);

        if ($scheme === 'http') {
            $this->isSecure = false;
        } elseif ($scheme === 'https') {
            $this->isSecure = true;
        } else {
            throw new \InvalidArgumentException('The scheme must be http or https.');
        }

        return $this;
    }