boost::urls::url_base::remove_port

Remove the port

Synopsis

Declared in <include/boost/url/url_base.hpp>

url_base&
remove_port() noexcept;

Description

If a port exists, it is removed. The rest of the authority is unchanged.

assert( url( "http://www.example.com:80" ).remove_port().authority().buffer() == "www.example.com" ); this->has_port() == false && this->port_number() == 0 && this->port() == ""

Linear in `this->size()`.

Throws nothing.

authority = [ userinfo "@" ] host [ ":" port ] port = *DIGIT
  • 3.2.3. Port (rfc3986)
  • See Also

    set_port .

    Created with MrDocs