//Advanced Delphi Systems Code: ads_wbServ
{Copyright(c)2000 Advanced Delphi Systems

 Richard Maley
 Advanced Delphi Systems
 12613 Maidens Bower Drive
 Potomac, MD 20854 USA
 phone 301-840-1554
 maley@advdelphisys.com

 The code herein can be used or modified by anyone.  Please retain references
 to Richard Maley at Advanced Delphi Systems.  If you make improvements to the
 code please send your improvements to maley@advdelphisys.com so that the
 entire Delphi community can benefit.  All comments are welcome.

 Please note if you are viewing this Delphi unit as a web page all you have to
 do to turn it into a Delphi unit is save it with a ".pas" extension.  The
 html in the unit should not affect its performance.
}
unit ads_wbServ;

(*
UnitIndex Master Index Implementation Section Download Units
Description: ads_wbServ.pas
This unit contains the following routines.

TWebModule1.WebModule1WebActionItem1Action 

*)
interface

uses
  Windows, Messages, SysUtils, Classes, HTTPApp;

type
  TWebModule1 = class(TWebModule)
    PageProducer1: TPageProducer;
    procedure WebModule1WebActionItem1Action(Sender: TObject;
      Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  WebModule1: TWebModule1;  

implementation


{$R *.DFM}

//
Unit Description UnitIndex Master Index
procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;
  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
   Page: TStringList;
begin
   Page := TStringList.Create;
   try
     with Page do
     begin
          Add('');
          Add('');
	  Add('Web Server Extensions THTTPRequest Demo');
          Add('');
          Add('');

          Add('

This page displays the properties of the HTTP request that asked for it.

'); Add('

'); Add('Method = ' + Request.Method + '
'); Add('ProtocolVersion = ' + Request.ProtocolVersion + '
'); Add('URL = ' + Request.URL + '
'); Add('Query = ' + Request.Query + '
'); Add('PathInfo = ' + Request.PathInfo + '
'); Add('PathTranslated = ' + Request.PathTranslated + '
'); Add('Authorization = ' + Request.Authorization + '
'); Add('CacheControl = ' + Request.CacheControl + '
'); Add('Cookie = ' + Request.Cookie + '
'); Add('Date = ' + FormatDateTime ('mmm dd, yyyy hh:mm', Request.Date) + '
'); Add('Accept = ' + Request.Accept + '
'); Add('From = ' + Request.From + '
'); Add('Host = ' + Request.Host + '
'); Add('IfModifiedSince = ' + FormatDateTime ('mmm dd, yyyy hh:mm', Request.IfModifiedSince) + '
'); Add('Referer = ' + Request.Referer + '
'); Add('UserAgent = ' + Request.UserAgent + '
'); Add('ContentEncoding = ' + Request.ContentEncoding + '
'); Add('ContentType = ' + Request.ContentType + '
'); Add('ContentLength = ' + IntToStr(Request.ContentLength) + '
'); Add('ContentVersion = ' + Request.ContentVersion + '
'); Add('Content = ' + Request.Content + '
'); Add('Connection = ' + Request.Connection + '
'); Add('DerivedFrom = ' + Request.DerivedFrom + '
'); Add('Expires = ' + FormatDateTime ('mmm dd, yyyy hh:mm', Request.Expires) + '
'); Add('Title = ' + Request.Title + '
'); Add('RemoteAddr = ' + Request.RemoteAddr + '
'); Add('RemoteHost = ' + Request.RemoteHost + '
'); Add('ScriptName = ' + Request.ScriptName + '
'); Add('ServerPort = ' + IntToStr(Request.ServerPort) + '
'); Add(''); Add(''); end; PageProducer1.HTMLDoc := Page; Response.Content := PageProducer1.Content; finally Page.Free; end; Handled := True; end; end. //