[#boost-urls-url_view_base-encoded_authority] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url_view_base.adoc[url_view_base]::encoded_authority :relfileprefix: ../../../ :mrdocs: Return the authority. == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L559[boost/url/url_view_base.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:boost/urls/pct_string_view.adoc[pct_string_view] encoded_authority() const noexcept; ---- == Description If present, this function returns a string representing the authority (which may be empty). Otherwise it returns an empty string. The returned string may contain percent escapes. === Example [,cpp] ---- assert( url_view( "file://Network%20Drive/My%2DFiles" ).encoded_authority() == "Network%20Drive" ); ---- === Complexity Constant. === Exception Safety Throws nothing. === BNF [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] ---- === Specification * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3.2. Authority (rfc3986)] Return the authority. If present, this function returns a string representing the authority (which may be empty). Otherwise it returns an empty string. The returned string may contain percent escapes. === Example [,cpp] ---- assert( url_view( "file://Network%20Drive/My%2DFiles" ).encoded_authority() == "Network%20Drive" ); ---- === Complexity Constant. === Exception Safety Throws nothing. === BNF [,cpp] ---- authority = [ userinfo "@" ] host [ ":" port ] ---- === Specification * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3.2. Authority (rfc3986)] == See Also xref:boost/urls/url_view_base/authority.adoc[authority], xref:boost/urls/url_view_base/has_authority.adoc[has_authority]. xref:boost/urls/url_view_base/authority.adoc[authority], xref:boost/urls/url_view_base/has_authority.adoc[has_authority]. [.small]#Created with https://www.mrdocs.com[MrDocs]#