:relfileprefix: ../../../ [#boost-urls-authority_view-encoded_host_name] == xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/authority_view.adoc[pass:[authority_view]]::encoded_host_name Return the host name === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost/urls/pct_string_view.adoc[pct_string_view] encoded_host_name() const noexcept; ---- === Description If the host type is xref:boost/urls/host_type/name.adoc[host_type::name] , this function returns the name as a string. Otherwise, if the host type is not an name, it returns an empty string. The returned string may contain percent escapes. [,cpp] ---- assert( url_view( "https://www%2droot.example.com/" ).encoded_host_name() == "www%2droot.example.com" ); ---- === Constant. === Throws nothing. [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)]