TIsapiConn 1.09.00
==================

Files:

  ISAPIVars.pas     Var's & Const's for the MS-IIS API
  ISAPIConn.pas     Class that encapsulates the MS-IIS API

  ISAPIConn.dcu     Compiled ISAPIConn.pas
  ISAPIVars.dcu     Compiled ISAPIVars.pas

  Template.dpr      Template Project, basic framework
  TemplateDB.pas    Template Project, basic framework with database connectivity

  iEcho.dpr         Demo 
  iEcho.htm         Startpage for iEcho.dll (put iEcho.dll to your /scripts directory)



Reference
=========

    TISAPIConn
    ----------

    CONSTRUCTOR Create(ptrECB : POINTER; BufferSize : DWORD);

       - BufferSize gives the amount of bytes that should be allocated for the sendbuffer


    PROCEDURE SendError(Msg : STRING);

       - Sends an error message to the client, last way to send
         if omething fails

    PROPERTY Status          : WORD      

       - If status is not 'stOK', then there has been an fatal
         error

    PROPERTY Error           : STRING 
  
       - The error message

    PROPERTY Request         : TRequest  

       - The Request Object

    PROPERTY Response        : TResponse 

       - The Response Object

    PROPERTY ServerLogString : STRING 

       - This string will be added to the webserver log



    Request
    -------

    PROPERTY ContentLen               : DWORD  

       - Len of received data

    PROPERTY ContentType              : STRING 
 
       - Type of received data

    PROPERTY Method                   : WORD   

       - GET or POST

    PROPERTY ServerVar[Name: STRING]  : STRING 

       - Gets the value of a server var. See the predefined consts.

    PROPERTY QueryField[Name: STRING] : STRING 

       - Gets the value of the querystring field 'Name'. If this field doesn't exists, an
         empty string will be returned.

    PROPERTY FormField[Name: STRING]  : STRING 

       - Gets the value of the posted field 'Name'. If this field doesn't exists, an
         empty string will be returned.

    PROPERTY Cookie[Name: STRING]     : STRING 

       - Gets the value of a cookie named 'Name'. If this cookie doesn't exists, an
         empty string will be returned.

    PROPERTY Data                     : POINTER 

       - Pointer to the buffer that contains the received data



    Response
    --------

    PROCEDURE ClearBuffer;

       - Flushes the sendbuffer, all data contained will be lost

    PROCEDURE FlushBuffer;

       - Sends data contained in the responsebuffer. Allways call it at the end of processing.

    PROCEDURE SendBuffer(Buffer : POINTER; Size : DWORD);

       - Sends data contained in Buffer to the client (usefull if you work with 
         streams)

    PROCEDURE Send(s : STRING);

       - Sends a STRING, with CRLF! If the sendbuffer is full data contained in this
         buffer will be sent to the client, then the buffer is flushed and filled with
         new data, so you don't have to worry about buffersizes.

    PROCEDURE HTMLBegin(Title : STRING; BodyBkg : STRING; BodyInit : STRING);
    PROCEDURE HTMLEnd;

    PROCEDURE SendURLRedirect(URL : STRING);

       - Redirects the client to another URL (you have to pass a full qualified URL, like 'http://www.icore.ch')
         Never call after you have called SendResponseHeader!

    PROCEDURE SendLocalURL(URL : STRING);

       - Redirects to an local URL, must be on the Server (pathinfo only), like '/mysite/default.htm' 
         Never call after you have called SendResponseHeader!

    PROCEDURE SendResponseHeader;

       - Send the response header to the client. Allways call it before you write data to the
         sendbuffer.

    PROCEDURE AddCookie(Name, Value, Expires, Path, Domain : STRING);

       - Adds a cookie. All params, except 'Expires' are needd. If you don't set 'Expires'
         your cookie will only be valid for he day it has been set on the browser.
         Call it before SendResponseHeader.

    PROCEDURE AddHTTPHeader(Header : STRING);

       - Adds an HTTP header. Usefull if you want add more information to your response
         (as an example the 'Last-Modified' Header can be set with time and date).
         Call it before SendResponseHeader.

    PROPERTY ContentType  : STRING READ FContentType  WRITE SetContentType;

       - Use to change the content type (default: text/html), must be set before calling
         SendResponseHeader

    PROPERTY ResponseCode : STRING READ FResponseCode WRITE SetResponseCode;

       - Use to change the response code (default: 200 OK), must be set before calling
         SendResponseHeader

    PROPERTY FilterText   : BOOLEAN READ FFilterText  WRITE FFilterText;

       - If it is TRUE, Send() will scan the string for special characters (using AsciiToHTML function)

    PROPERTY SkipHTMLTag  : BOOLEAN READ FSkipHTMLTag WRITE FSkipHTMLTag;

       - If TRUE 'AsciiToHTML' will skip HTML tags in the string when filtering (FilterText = TRUE); 
         else it will replace '<' and '>'



    Suport functions
    ----------------    

    FUNCTION  AsciiToHtml(s : STRING; SkipHTMLTag : BOOLEAN): STRING;

     - Replaces all special characters with the '&...;' equivalent
       If SkipHTMLTag is TRUE, Tags contained in s will be skiped

    FUNCTION  URLDecode(s : STRING): STRING;

     - Decodes an URLEncoded string

    PROCEDURE URLEncode(VAR URLString : STRING; s : STRING; SetAmpersand : BOOLEAN);

     - Encodes a string to an URLEncoded string. IF URLString is not empty s will be 
       added to URLString else URLString := s.
       IF SetAmpersand is TRUE, a '&' will be added at the beginning of s 
       (easy way to build an URLEncoded string to add as parameter to an URL)

    FUNCTION  Base64Encode(s : STRING): STRING;

     - Performs a Base64 encoding of a string

    FUNCTION  Base64Decode(s : STRING): STRING;

     - Performs a Base64 decoding of a string,
       you need this, if you want to get Username
       and Password from HTTP_AUTHORIZATION



History
=======


Version 1.09.00
----------------

- Redesign of the class. Functionality is now separated into
  two logical units 'Request' and 'Response' (similar to ASP)

- Posted data above 48k will be handled correctly now (Version 
  1.08.00 has a bug)

- Added cookie support

- Added response header support (you can add HTTP Headers to your
  response)

- Added Base64 encoding/decoding support (needed for decoding 
  basic authentication)


Version 1.08.00
----------------

- Posted data above 48k will be handled now (not tested yet, but should work)
- Implementation of SendStream
- Removed SendHTMLFile due the implementation of SendStream
- Fixed some minor bugs in HTTPSendResponseHeader

Version 1.07.00
----------------

- Fixed some minor bugs


Version 1.06.00
----------------

- Easyier handling of Querystrings and Posted Data

- Added URLEncode/Decode Routines

- URLRedirect Functions implemented

- Some minor changes in Code


Version 1.01.00
----------------

- Now the Buffer that can be Allocated isn't limited to 64k 

- Filtering is performed in "Send" and "BeginHTML" routines only.
  DB Fields that are used for Query Strings are not filtered, DB
  Fields that are used to display Information on the HTML-Document
  are Filtered (if FilterOn is TRUE).

- Querystrings with Spaces and special Characters (like the German 
    ) are supported, so Strings from a Database containing German,
  Italian, French and Spanish Text can be displayed correctly.