:relfileprefix: ../../../
[#30FB862DEE260B238A492427ED2E1D87748C5FDD]

= Function static_url::remove_authority

pass:v,q[Remove the authority]


== Synopsis

Declared in header `</boost/url/static_url.hpp#L354[boost/url/static_url.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:boost/urls/static_url.adoc[static_url]&
remove_authority();
----

== Description

pass:v,q[This function removes the authority,] pass:v,q[which includes the userinfo, host, and]
pass:v,q[a port if present.]

=== Example
[,cpp]
----
assert( url( "http://example.com/echo.cgi" ).remove_authority().buffer() == "http:/echo.cgi" );
----

=== Postconditions
[,cpp]
----
this->has_authority() == false && this->has_userinfo() == false && this->has_port() == false
----

=== Complexity
pass:v,q[Linear in `this->size()`.]

=== Exception Safety
pass:v,q[Throws nothing.]

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

userinfo      = *( unreserved / pct-encoded / sub-delims / ":" )
host          = IP-literal / IPv4address / reg-name
port          = *DIGIT
----

=== Specification

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



== Return Value

* `` 




