Return the hostname.
string_view encoded_hostname() const;
This function returns the hostname with percent-encoding. 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( "wss://[2001:0db8::0370:7334]/index.htm" ); assert( u.encoded_hostname() == "2001:0db8::0370:7334" );
host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]"
Throws nothing.
encoded_host
, encoded_host_and_port
, has_port
, host
, hostname
, host_type
, port
, port_number
.