TsgcHTTPServer › Properties › ParseParams
Parses the query string and form-urlencoded body of every request into ARequestInfo.Params.
property ParseParams: Boolean read GetParseParams write SetParseParams;
True
When ParseParams is True (the default), the underlying Indy HTTP server decodes the request's query string and, for an application/x-www-form-urlencoded POST body, the form fields as well, making every name/value pair available through ARequestInfo.Params inside OnCommandGet / OnCommandOther. Set it to False to skip this parsing step, for example when the server mostly handles raw JSON or binary bodies read directly from ARequestInfo.PostStream and the extra parsing would be wasted work.
oServer := TsgcHTTPServer.Create(nil);
oServer.ParseParams := true;
procedure OnCommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo;
AResponseInfo: TIdHTTPResponseInfo);
begin
AResponseInfo.ContentText := 'name=' + ARequestInfo.Params.Values['name'];
end;