src/Http/ServerRequest.php
public function getRequestTarget()
    {
        if (!$this->uri) {
            return '/';
        }

        $query_string = '';
        if ($this->uri->getQuery()) {
            $query_string = '?'.http_build_query($this->uri->getQuery());
        }

        return $this->uri->getPath().$query_string;
    }
public function getRequestTarget()
    {
        if (!$this->uri) {
            return '/';
        }

        $query_string = '';
        if ($this->uri->getQuery()) {
            $query_string = '?'.http_build_query($this->uri->getQuery());
        }

        return $this->uri->getPath().$query_string;
    }
Retrieves the message's request target.
Retrieves the message's request-target either as it will appear (for
clients), as it appeared at request (for servers), or as it was
specified for the instance (see withRequestTarget()).
In most cases, this will be the origin-form of the composed URI,
unless a value was provided to the concrete implementation (see
withRequestTarget() below).
If no URI is available, and no request-target has been specifically
provided, this method MUST return the string "/".

@return string