//------------------------------------------------------------------------------ // Uint: 例子/查询字符串 //------------------------------------------------------------------------------ unit querystring; interface uses System.SysUtils, System.IOUtils, System.Classes, FireHttp.Utils, FireHttp.Types, FireHttp.Classes, FireHttp.HTML, FireHttp.Path, FireHttp.Log, FireHttp.Config; type example_querystring = class(THTMLHandler) public const __PathInfo = '/querystring'; const __Description = ''; protected procedure Execute; override; procedure Cleanup; override; public constructor Create(AThread: TWorkerThread); override; destructor Destroy; override; end; implementation { example_querystring } procedure example_querystring.Cleanup; begin inherited; end; constructor example_querystring.Create(AThread: TWorkerThread); begin inherited Create(AThread); {$region '设置处理者'} MultiPathInfo.Add(__PathInfo); Description := __Description; {$endregion} end; destructor example_querystring.Destroy; begin inherited; end; procedure example_querystring.Execute; var i: Integer; objField: THttpField; ul, li: THTMLElement; begin inherited; Document.Title.Text := 'QueryString'; ul := Document.CreateElement_UL(Document.Body); for i := 0 to Request.QueryFields.Count - 1 do begin objField := Request.QueryFields.Items[i]; li := Document.CreateElement_LI(ul); li.Text := objField.Name + '=' + objField.Value; end; end; initialization RegisterHandlerClass(example_querystring); end.