url.escapedPath

This function returns the escaped path part of the URL, removing everything except the PATH after the hostname.

Syntax

url.escapedPath(rawURLString)

Arguments

Argument

Type

Description

rawURLString

string

Raw URL string

Returns

Type

Description

string

Escaped path part of the URL

Examples

The function url.escapedPath("https://example.com:8080/root-path/sub%2Fpath?query=example+query+%2F+question#fragment") returns "/root-path/sub%2Fpath".