Skip to main content

2.2.7. Query

2.2.7. Query

The @query derived component refers to the query component of the HTTP request message. The component value is the entire normalized query string defined by [URI], including the leading ? character. The value is read using the simple string comparison rules provided in Section 6.2.1 of [URI]. Namely, percent-encoded octets are not decoded.

For example, the following request message:

GET /path?param=value&foo=bar&baz=bat%2Dman HTTP/1.1 Host: www.example.com

would result in the following @query component value:

?param=value&foo=bar&baz=bat%2Dman

and the following signature base line:

"@query": ?param=value&foo=bar&baz=bat%2Dman

The following request message:

POST /path?queryString HTTP/1.1 Host: www.example.com

would result in the following @query component value:

?queryString

and the following signature base line:

"@query": ?queryString

Just like including an empty path component, the signer can include an empty query component to indicate that this component is not used in the message. If the query string is absent from the request message, the component value is the leading ? character alone:

?

resulting in the following signature base line:

"@query": ?