![]() |
Home | Libraries | People | FAQ | More |
(Inherited from url_base
)
Set the password.
url_base& set_password( core::string_view s);
This function sets the password in the userinfo to the string. Reserved characters in the string are percent-escaped in the result.
The interpretation of the userinfo as individual user and password components is scheme-dependent. Transmitting passwords in URLs is deprecated.
assert( [link url.ref.boost__urls__url_base.url `url`]( "http://user@example.com" ).[link url.ref.boost__urls__static_url_base.set_password `set_password`]( "pass" ).[link url.ref.boost__urls__static_url_base.encoded_userinfo `encoded_userinfo`]() == "user:pass" );
this->[link url.ref.boost__urls__static_url_base.has_password `has_password`]() == true && this->[link url.ref.boost__urls__static_url_base.password `password`]() == s
Strong guarantee. Calls to allocate may throw.
Name |
Description |
---|---|
|
The string to set. This string may contain any characters, including nulls. |
[link url.ref.boost__urls__static_url_base.userinfo `userinfo`] = [ [ [link url.ref.boost__urls__static_url_base.user `user`] ] [ ':' [link url.ref.boost__urls__static_url_base.password `password`] ] ] [link url.ref.boost__urls__static_url_base.user `user`] = *( unreserved / pct-encoded / sub-delims ) [link url.ref.boost__urls__static_url_base.password `password`] = *( unreserved / pct-encoded / sub-delims / ":" )
remove_password
, set_encoded_password
, set_encoded_user
, set_user
.