[#boost-urls-url_base-remove_authority] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url_base.adoc[url_base]::remove_authority :relfileprefix: ../../../ :mrdocs: Remove the authority == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L437[boost/url/url_base.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:boost/urls/url_base.adoc[url_base]& remove_authority(); ---- == Description This function removes the authority, which includes the userinfo, host, and 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 Linear in `this‐>size()`. === Exception Safety 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)] == See Also xref:boost/urls/url_base/set_encoded_authority.adoc[set_encoded_authority]. [.small]#Created with https://www.mrdocs.com[MrDocs]#