set_port
Set the port
Synopsis
url_base&
set_port(string_view s);
Declared in file <include/boost/url/url_base.hpp> on line 1565
Defined in file <src/url_base.cpp> on line 959
Description
This port is set to the string, which must contain only digits or be empty. An empty port string is distinct from having no port.
Example
assert( url( "http://www.example.com" ).set_port( "8080" ).authority().buffer() == "www.example.com:8080" );
Postconditions
this->has_port() == true && this->port_number() == n && this->port() == std::to_string(n)