Set the authority

Synopsis

Declared in header </boost/url/url_base.hpp#L361[boost/url/url_base.hpp,window=blank_]>

url_base&
set_encoded_authority(pct_string_view s);

Description

This function sets the authority to the specified string. The string may contain percent-escapes.

Example

assert( url().set_encoded_authority( "My%20Computer" ).has_authority() );

Exception Safety

Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input.

BNF

authority     = [ userinfo "@" ] host [ ":" port ]

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

Return Value

  • ``

Parameters

Name Type

s

pct_string_view