public function setPath(string $path) : Request
    {
        if (strpos($path, '?') !== false) {
            throw new \InvalidArgumentException('The request path must not contain a query string.');
        }

        $this->path = $path;

        return $this->updateRequestUri();
    }