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

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


Return the authority


=== Synopsis

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

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:boost/urls/authority_view.adoc[authority_view]
authority() const noexcept;
----

=== Description


This function returns the authority as
an
xref:boost/urls/authority_view.adoc[authority_view]
.
[,cpp]
----
authority_view a = url_view( "https://www.example.com:8080/index.htm" ).authority();
----

=== 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/encoded_authority.adoc[encoded_authority]
,
xref:boost/urls/url_view_base/has_authority.adoc[has_authority]
.



