HTTP Request - Response API

  IE2ServerClientThreadPublic = interface(IInterface)


{Utility Procedure:}
    procedure SwitchSlashes(var s: string);

{Special Plugin Function}
    function GetClass(const ClassName: string): TPersistentClass;


{HTTP Response Procedures:}

	   For many mime types including custom classes, Electron Server will create the HTTP Response Header
	   before passing this thread interface class into the Plug-in Class' ExecuteModule() method.  There may
	   be times when a developer may want to start with an complete emtpy HTTP Response stream.  At these time
	   user ClearSendStream() to clear the Response stream.  But don't forget to write your own HTTP Response Header,
	   look at one of the samples to see how. 

    procedure ClearSendStream;
    
	   This method appends a string (of length no greater than 4096 bytes) to the end of the HTTP Response stream.
	   To send large strings use QueueStringAsStream(); 
	   e.g. thread.QueuStr('<html><body><H3>Hello World!</H3><body></html>') 
    procedure QueueStr(Str: String);
    
	   Use this method to append large strings to the HTTP Response Stream. 
    procedure QueueStringAsStream(Str: String);  
    
	   Use this method to append a buffer to the HTTP Response Stream.
    procedure QueueBuffer(var Buffer; Len: Integer);
    
	   Use this stream to append a stream to the HTTP Response Stream.
    procedure QueueStream(strm: tStream);
    
	   If you have used ClearSendStream() then you may use this method to automatically create and append the your 
	   custom plug-in class' Content Type (aka MIME Type).
    procedure QueueContentType;
    
{Logging Procedure:}

	   Use this method to write a log message to the built-in or custom logger plug-in.  
		Set to the debug param to TRUE if you wish to designate the message as a debug message
		in which case it will only show up in the Log Memo when "see debug msgs" is toggled ON.  
    procedure DoMessage(msg: string; debug:boolean);
    
    


{Read Only Properties:}

    
	   This property indicates are "GET" or "POST" HTTP request. 
    property Method : String ;
    
	   This property indicates the document name of the "file" part of a URL.
    property Document : String ;
    
	   This property indicates the HTTP version ("1.0", "1.1" etc.) of the HTTP Request.
    property Version : String ;
    
	   This indicates the Content Type (MIME Type) of the HTTP Response.

    property ContentType : String;
    
	   This property is a Stringlist contains in-coming Form Vars (if any) posted in the HTTP Request stored as name=value pairs.. 
    property FormVars:TStringlist;
    
	   This Domain Name target (e.g. "www.myhome.com") of the HTTP Request.  
    property Host:String;
    
	   This property contains the full HTTP Request Header stored as name=value pairs. 
    property HeaderList : TStringlist;
    
	   Thread ID of the thread this interface represents.
    property ThreadId:THandle;
    
	   This property will retrieve single named Browser Variables from the Header property.
    property BrowserVars[Name: String]:String
    
	   This property is stringlist containing all the Domain Mappings valid for this web server. 
    property DomainMapping:TStringlist;
    

{Read/Write Property:}

	   This property holds the Query String value which is that part of the URL after the "?".
		It is read/write, so that the Query String can be modified as it under-goes processing by 
		more than one procedure on the way to producing an HTTP Response.	
    property QString : String read  GetQString write SetQString;
  end;