Boost.URL Logo

PrevUpHomeNext
url_view::encoded_hostname

Return the hostname.

Synopsis
string_view
encoded_hostname() const;
Description

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.

Example
url_view u( "wss://[2001:0db8::0370:7334]/index.htm" );

assert( u.encoded_hostname() == "2001:0db8::0370:7334" );
BNF
host        = IP-literal / IPv4address / reg-name

IP-literal  = "[" ( IPv6address / IPvFuture  ) "]"
Exception Safety

Throws nothing.

Specification
See Also

encoded_host, encoded_host_and_port, has_port, host, hostname, host_type, port, port_number.


PrevUpHomeNext