requestRelativePath

Gets a request-relative path string for this URL which is suitable for use in an HTTP request line. The given path will include query parameters and the fragment and will be prepended with a / (even for empty paths without a trailing slash configured). It will not include the protocol, host, port, or user info.

For example:

/path/to/resource?key=value#fragment