Skip to content

getPath

getPath(url) → string · URL

Get the path component from a URL string.

  • url (required): URL string
bash
echo '{"url": "https://api.example.com/v1/users/123"}' | utlx -e 'getPath($input.url)'
# "/v1/users/123"
utlx
{
  path: getPath($input.endpoint)
}

Released under AGPL-3.0.