:relfileprefix: ../../../
[#boost-urls-url_view_base-encoded_authority]

== xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/url_view_base.adoc[pass:[url_view_base]]::encoded_authority


Return the authority.


=== Synopsis

Declared in header `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L566[boost/url/url_view_base.hpp,window=blank_]>`

[source,cpp,subs="verbatim,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.
[,cpp]
----
assert( url_view( "file://Network%20Drive/My%2DFiles" ).encoded_authority() == "Network%20Drive" );
----

=== Constant.

=== Throws nothing.
[,cpp]
----
authority   = [ userinfo "@" ] host [ ":" port ]
----

* 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]
.



