:relfileprefix: ../../../ [#453FB9931BC2118FAB0414EC6E0CE8A118BBDEB3] = Function url::set_password pass:v,q[Set the password.] == Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost/urls/url.adoc[url]& set_password(string_view s); ---- == Description pass:v,q[This function sets the password in] pass:v,q[the userinfo to the string.] pass:v,q[Reserved characters in the string are] pass:v,q[percent-escaped in the result.] [NOTE] pass:v,q[The interpretation of the userinfo as] pass:v,q[individual user and password components] pass:v,q[is scheme-dependent. Transmitting] pass:v,q[passwords in URLs is deprecated.] === Example [,cpp] ---- assert( url("http://user@example.com").set_password( "pass" ).encoded_userinfo() == "user:pass" ); ---- === Postconditions [,cpp] ---- this->has_password() == true && this->password() == s ---- === Exception Safety pass:v,q[Strong guarantee.] pass:v,q[Calls to allocate may throw.] === BNF [,cpp] ---- userinfo = [ [ user ] [ ':' password ] ] user = *( unreserved / pct-encoded / sub-delims ) password = *( unreserved / pct-encoded / sub-delims / ":" ) ---- === Specification * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[ 3.2.1. User Information (rfc3986)] == Return Value * `` == Parameters |=== | Name | Type | *s* | `string_view` |===