[#boost-urls-authority_view-encoded_host] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/authority_view.adoc[authority_view]::encoded_host :relfileprefix: ../../../ :mrdocs: Return the host == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/authority_view.hpp#L743[boost/url/authority_view.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:boost/urls/pct_string_view.adoc[pct_string_view] encoded_host() const noexcept; ---- == Description This function returns the host portion of the authority as a string, or the empty string if there is no authority. The returned string may contain percent escapes. === Example [,cpp] ---- assert( url_view( "https://www%2droot.example.com/" ).encoded_host() == "www%2droot.example.com" ); ---- === Complexity Constant. === Exception Safety Throws nothing. === BNF [,cpp] ---- host = IP-literal / IPv4address / reg-name IP-literal = "[" ( IPv6address / IPvFuture ) "]" reg-name = *( unreserved / pct-encoded / "-" / ".") ---- === Specification * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3.2.2. Host (rfc3986)] [.small]#Created with https://www.mrdocs.com[MrDocs]#