:relfileprefix: ../../../
[#CB392AFAE0A66D3957ADF0EEC9DD5F4F466EEB1C]

= Function url_view_base::encoded_userinfo

pass:v,q[Return the userinfo]


== Synopsis

Declared in header `</boost/url/url_view_base.hpp#L746[boost/url/url_view_base.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:boost/urls/pct_string_view.adoc[pct_string_view]
encoded_userinfo() const noexcept;
----

== Description

pass:v,q[If present, this function returns a] pass:v,q[string representing the userinfo (which]
pass:v,q[may be empty).]
pass:v,q[Otherwise it returns an empty string.]
pass:v,q[The returned string may contain]
pass:v,q[percent escapes.]

=== Example
[,cpp]
----
assert( url_view( "http://jane%2Ddoe:pass@example.com" ).encoded_userinfo() == "jane%2Ddoe:pass" );
----

=== Complexity
pass:v,q[Constant.]

=== Exception Safety
pass:v,q[Throws nothing]

=== BNF
[,cpp]
----
userinfo    = user [ ":" [ password ] ]

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

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1[3.2.1. User Information (rfc3986)]



== Return Value

* `pct_string_view` 




