unit Unit1;
interface
uses
SysUtils, Classes, HTTPApp, DB, DBTables, DBWeb, DBBdeWeb;
type
TWebModule1 = class(TWebModule)
Session1: TSession;
Database1: TDatabase;
Query1: TQuery;
QueryTableProducer1: TQueryTableProducer;
procedure WebModule1WebActionItem1Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
procedure WebModule1WebActionItem2Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
WebModule1: TWebModule1;
implementation
{$R *.DFM}
procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
Response.Content := Response.Content+'<P>'+'Host : '+Request.Host+'</P>';
Response.Content := Response.Content+'<P>'+'PathInfo : '+Request.PathInfo+'</P>';
Response.Content := Response.Content+'<P>'+ 'QueryFields : '+Request.QueryFields.Text+'</P>';
Response.Content := Response.Content+'<P>'+'ContentFields : '+Request.ContentFields.Text+'</P>';
Handled:=True;
end;
procedure TWebModule1.WebModule1WebActionItem2Action(Sender: TObject;
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
try
QueryTableProducer1.Query.Open;
Response.Content:=QueryTableProducer1.Content;
finally
QueryTableProducer1.Query.Close;
end;
Response.Content:=Response.Content+'<P>'+'ContentFields : '+Request.ContentFields.Text+'</P>';
Response.Content:=Response.Content+'<P>'+'QueryFields:'+ Request.QueryFields.Text+'</P>';
Response.Content:=Response.Content+'<P>The End</P>';
Handled:=True;
end;
end.