Query
property Query: string read;
Example
procedure ScriptEvent(var Value: variant);
begin
if Request <> nil then
Value := Request.Query
else
Value := '';
end;
Usage
Returns the encoded query substring after the first question mark, excluding the question mark and without parsing fields.
Additional Technical Info
Query returns TIdHTTPRequestInfo.QueryParams. Indy separates the request target at the first ?; the value after it is retained without the question mark, while the path continues through URI parsing. If there is no ?, the result is empty.
The string remains percent-encoded. It is not split into names/values and should not be concatenated directly into another URI, SQL, logs or signatures. The exact distinction between empty query and no query marker is lost because both return ''.
Use QueryFields for the bridge's mutable decoded list, while reading its duplicate, decoding and partial-cache caveats. For cryptographic verification or a protocol that needs exact request-target bytes, note that this property is only the stored query component and that normalisation/reconstruction can change meaning.
Treat the value as untrusted, length-bound input. Define accepted parameter names/counts/sizes, reject unexpected duplicates and decode exactly once. Secrets in query strings are easily exposed through logs, browser history and intermediaries; prefer protected headers/body fields. Test Request for nil.
External references
Created 2026-07-15