:relfileprefix: ../../
[#boost-urls-query_rule]

== xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::query_rule


Rule for query


=== Synopsis

Declared in header `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/query_rule.hpp#L110[boost/url/rfc/query_rule.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
constexpr
pass:q[_implementation-defined_] query_rule = {};
----

=== Description

[,cpp]
----
using value_type = params_encoded_view;
----

=== Rules are used with the function

xref:boost/urls/grammar/parse-02.adoc[grammar::parse]
.
[,cpp]
----
system::result< params_encoded_view > rv = grammar::parse( "format=web&id=42&compact", query_rule );
----
[,cpp]
----
query           = *( pchar / "/" / "?" )

query-params    = [ query-param ] *( "&" query-param )
query-param     = key [ "=" value ]
key             = *qpchar
value           = *( qpchar / "=" )
qpchar          = unreserved
                / pct-encoded
                / "!" / "$" / "'" / "(" / ")"
                / "*" / "+" / "," / ";"
                / ":" / "@" / "/" / "?"
----

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.4[3.4. Query (rfc3986)]



=== See Also


xref:boost/urls/grammar/parse-02.adoc[grammar::parse]
,
xref:boost/urls/params_encoded_view.adoc[params_encoded_view]
.



