[#9AD6406FF4EAA95725C1EA110E914F0306FEA4F0]

Function params_view:: params_view

Constructor

Synopsis

            params_view(core::string_view s);
        

Description

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

Example

params_view qp( "first=John&last=Doe" );

Effects

return parse_query( s ).value();

Postconditions

this->buffer().data() == s.data()

Complexity

Linear in `s`.

Exception Safety

Exceptions thrown on invalid input.

BNF

query-params = [ query-param ] *( "&" query-param ) query-param = key [ "=" value ]

Specification

  • 3.4. Query