This instance represents a relative URI, and this property is valid only for absolute URIs.
Examples
The following example creates a xtd::uri instance from a string. It illustrates the difference between the value returned from xtd::uri::host, which returns the host name or address specified in the URI, and the value returned from xtd::uri::dns_safe_host, which returns an address that is safe to use in DNS resolution.
// Create new Uri using a string address.
auto address = uri("http://[fe80::200:39ff:fe36:1a2d%254]/temp/example.htm");
// Make the address DNS safe.
// The following outputs "[fe80::200:39ff:fe36:1a2d]".
As explained in Remarks, unescape the host name before resolving it. You can use the xtd::uri::unescape_data_string method to unescape the host name, and you can resolve it by calling the xtd::uri::get_host_entry method.
Remarks
For IPv6 addresses, the brackets ([]) are removed and the xtd::uri::scope_id property is set, if one was specified when this instance was constructed.