{ $Id: header,v 1.1 2000/07/13 06:33:45 michael Exp $ This file is part of the Free Component Library (FCL) Copyright (c) 1999-2000 by the Free Pascal development team See the file COPYING.FPC, included in this distribution, for details about the copyright. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. **********************************************************************} unit webutil; {$mode objfpc}{$H+} interface uses Classes, SysUtils, httpdefs; procedure DumpRequest (ARequest : TRequest; Dump : TStrings); implementation procedure DumpRequest (ARequest : TRequest; Dump : TStrings); Procedure AddNV(Const N,V : String); begin Dump.Add(''+N+''+V+''); end; Var I : integer; N,V : String; begin With ARequest, Dump do begin // All possible headers Add('

All possible request headers:

'); Add(''); For I:=1 to NoHTTPFields do begin AddNV(HTTPFieldNames[i],GetFieldByName(HTTPFieldNames[i])); end; Add('
HeaderValue

'); // Actually sent headers Add('

Actually sent request headers:

'); Add(''); For I:=0 to FieldCount-1 do AddNV(FieldNames[I],FieldValues[I]); Add('
HeaderValue

'); // Actually sent headers, as text Add('

Actually sent request headers as text:

'); For I:=0 to FieldCount-1 do Add(Fields[I]+'
'); // Additional headers Add('

Additional headers:

'); Add(''); AddNV('PathInfo',PathInfo); AddNV('PathTranslated',PathTranslated); AddNV('RemoteAddress',RemoteAddress); AddNV('RemoteHost',RemoteHost); AddNV('ScriptName',ScriptName); AddNV('ServerPort',IntToStr(ServerPort)); AddNV('Method',Method); AddNV('URL',URL); AddNV('Query',Query); AddNV('Host',Host); AddNV('Content',Content); Add('
HeaderValue

'); // Additional headers If (QueryFields.Count>0) then begin Add('

Request variables: ('+IntToStr(QueryFields.Count)+')

'); Add(''); For I:=0 to QueryFields.Count-1 do begin QueryFields.GetNameValue(i,N,V); AddNV(N,V); end; Add('
NameValue

'); end; If (Files.Count>0) then begin Add('

Uploaded files: ('+IntToStr(Files.Count)+')

'); Add(''); Add(''); Add(''); For I:=0 to Files.Count-1 do With Files[i] do begin Add(''); Add(''); Add(''); end; Add('
NameFileNameSizeTemp FileNameDispositionContent-Type
'+FieldName+''+FileName+''+IntToStr(Size)+''+LocalFileName+''+Disposition+''+ContentType+'

'); end; end; end; end.