[#boost-urls-params_encoded_view-2constructor-0c]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/params_encoded_view.adoc[params&lowbar;encoded&lowbar;view]::params&lowbar;encoded&lowbar;view
:relfileprefix: ../../../
:mrdocs:


Constructor

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_view.hpp#L169[boost&sol;url&sol;params&lowbar;encoded&lowbar;view&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
params&lowbar;encoded&lowbar;view(core::string&lowbar;view s);
----

== Description


This function constructs params from        a valid query parameter string, which        can contain percent escapes&period; Unlike        the parameters in URLs, the string        passed here should not start with &quot;?&quot;&period;        Upon construction, the view        references the character buffer pointed        to by `s`&period; The caller is responsible        for ensuring that the lifetime of the        buffer extends until it is no longer        referenced&period;


=== Example

[,cpp]
----
params_encoded_view qp( "first=John&last=Doe" );
----

=== Effects

[,cpp]
----
return parse_query( s ).value();
----

=== Postconditions

[,cpp]
----
this->buffer().data() == s.data()
----

=== Complexity

Linear in `s`&period;


=== Exception Safety

Exceptions thrown on invalid input&period;


=== BNF

[,cpp]
----
query-params    = [ query-param ] *( "&" query-param )

query-param     = key [ "=" value ]
----

=== Specification

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3&period;4&period;  Query]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| `s` contains an invalid query parameter        string&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
