:relfileprefix: ../../../ [#994098953806F4A31AA5D5B8ACC3461B2502D9E6] = Function static_url::set_encoded_password pass:v,q[Set the password.] == Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- xref:boost/urls/static_url.adoc[static_url]& set_encoded_password(xref:boost/urls/pct_string_view.adoc[pct_string_view] s); ---- == Description pass:v,q[This function sets the password in] pass:v,q[the userinfo to the string, which] pass:v,q[may contain percent-escapes.] pass:v,q[Escapes in the string are preserved,] pass:v,q[and reserved characters in the string] pass:v,q[are 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_encoded_password( "pass" ).encoded_userinfo() == "user:pass" ); ---- === Postconditions [,cpp] ---- this->has_password() == true ---- === 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* | `pct_string_view` |===