Skip to content

getHost

getHost(url) → string · URL

Get the host from a URL string.

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

Released under AGPL-3.0.