Return the hostname.
pct_encoded_view hostname() const;
This function returns the hostname with percent-encoding removed. The hostname
is formed from the host string, with the additional step of removing the
enclosing square brackets when the host type is host_type::ipv6
or host_type::ipvfuture
.
url_view u( "https://www%2droot.example.com/" ); assert( u.hostname() == "www-root.example.com" );
host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]"
Throws nothing.
encoded_host
, encoded_hostname
, encoded_host_and_port
, has_port
, host
, host_type
, port
, port_number
.