[#boost-urls-url_view_base-authority]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url_view_base.adoc[url&lowbar;view&lowbar;base]::authority
:relfileprefix: ../../../
:mrdocs:


Return the authority

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_view_base.hpp#L524[boost&sol;url&sol;url&lowbar;view&lowbar;base&period;hpp]&gt;`

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

== Description


This function returns the authority as        an xref:boost/urls/authority_view.adoc[authority&lowbar;view]&period;


=== Example

[,cpp]
----
authority_view a = url_view( "https://www.example.com:8080/index.htm" ).authority();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

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

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3&period;2&period; Authority (rfc3986)]

Return the authority

This function returns the authority as        an xref:boost/urls/authority_view.adoc[authority&lowbar;view]&period;


=== Example

[,cpp]
----
authority_view a = url_view( "https://www.example.com:8080/index.htm" ).authority();
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

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

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2[3&period;2&period; Authority (rfc3986)]



== See Also


xref:boost/urls/url_view_base/encoded_authority.adoc[encoded&lowbar;authority],            xref:boost/urls/url_view_base/has_authority.adoc[has&lowbar;authority]&period;



xref:boost/urls/url_view_base/encoded_authority.adoc[encoded&lowbar;authority],            xref:boost/urls/url_view_base/has_authority.adoc[has&lowbar;authority]&period;






[.small]#Created with https://www.mrdocs.com[MrDocs]#
