Platoo ISAPI ComponentsTFRISAPIResponse

Contents - Methods - Properties

ISAPI response incapsulation


Description
Created by TISAPIApp for every incoming request.


TFRISAPIResponse - Methods

Contents - TFRISAPIResponse - Properties

~TFRISAPIResponse
Destructor

C++ declaration
__fastcall virtual ~TFRISAPIResponse(void)

Description
Normally you should not free TFRISAPIResponse objects, it will be done by TISAPIApp.

AddCookie
Adding cookies to HTTP header ('Set-Cookie' header fields)

Delphi declaration
procedure AddCookie(Name, Value: AnsiString; Expires: TDateTime; Path, Domain: AnsiString; Secure: Boolean);
C++ declaration
void __fastcall AddCookie(System::AnsiString Name, System::AnsiString Value, System::TDateTime Expires, System::AnsiString Path, System::AnsiString Domain, bool Secure)

Description
Name - cookie name

Value - cookie value

Expires - datetime,

Path - URL path

Domain - domain name

To disable Expires, set it <= 0.

If Expires is evaluated, local time is expected. Before sending it will internally be converted into GMT.

See also cookies specification.

Append
Add string to HTMLResult

Delphi declaration
procedure Append(const S: String);
C++ declaration
void __fastcall Append(const System::AnsiString S)

Description
Does the same as TFRISAPIResponse.HTMLResult.Append , but shorter.

Create
Constructor

Delphi declaration
constructor Create(pECB: PEXTENSION_CONTROL_BLOCK);

Description
Normally you should not create TFRISAPIResponse objects, it will be created by TISAPIApp for every request.

Destroy
Destructor

Delphi declaration
destructor Destroy;

Description
Normally you should not free TFRISAPIResponse objects, it will be done by TISAPIApp.

Redirect
Redirecting client to other website

Delphi declaration
function Redirect(const sURL: String): Boolean;
C++ declaration
bool __fastcall Redirect(const System::AnsiString sURL)

Description
Internally uses server the supported ISAPI function HSE_REQ_SEND_URL_REDIRECT_RESP

Send
Send response header and html text/or stream to the client

Delphi declaration
function Send: Boolean;
C++ declaration
bool __fastcall Send(void)

Description
Called automatically after request-handling events, only once for one request.

SendStream
Internal stream sending

Delphi declaration
function SendStream(AStream: TStream): Boolean;
C++ declaration
bool __fastcall SendStream(Classes::TStream *AStream)

Description
Called from the Send function.

SendURL
Redirecting the client inside the same server

Delphi declaration
function SendURL(const sURL: String): Boolean;
C++ declaration
bool __fastcall SendURL(const System::AnsiString sURL)

Description
Internally uses the server supported ISAPI function HSE_REQ_SEND_URL

SetHTMLResult
Internal HTMLResult setter

Delphi declaration
procedure SetHTMLResult(Value: TStringList);
C++ declaration
void __fastcall SetHTMLResult(Classes::TStringList *Value)

Description
Erases previous HTMLResult.

SetResultStream
Internal ResultStream setter

Delphi declaration
procedure SetResultStream(Value: TStream);
C++ declaration
void __fastcall SetResultStream(Classes::TStream *Value)

Description
Frees the previous stream object, when evaluated.

TFRISAPIResponse
Constructor

C++ declaration
__fastcall TFRISAPIResponse(Isapi::PEXTENSION_CONTROL_BLOCK pECB)

Description
Normally you should not create TFRISAPIResponse objects, it will be created by TISAPIApp for every request.


TFRISAPIResponse - Properties

Contents - TFRISAPIResponse - Methods

CharSet
Charset HTTP header field

Delphi declaration
property CharSet: AnsiString read FCharSet write FCharSet;
C++ declaration
__property System::AnsiString CharSet={ read=FCharSet, write=FCharSet, nodefault }

Description
Default 'ISO-8859-1'

ContentType
Content-type HTTP header field

Delphi declaration
property ContentType: AnsiString read FContentType write FContentType;
C++ declaration
__property System::AnsiString ContentType={ read=FContentType, write=FContentType, nodefault }

Description
Default 'text/html'

Examples:

Plain text - 'text/plain'

JPEG image - 'image/jpeg'

PNG image - 'image/ png'

Zipped file - 'application/zip'

DebugString
Debug string

Delphi declaration
DebugString: AnsiString;
C++ declaration
System::AnsiString DebugString

Description
For debugging purposes.

This string will be added to logfile in the case of an unhandled exception.

Dispatcher
Current dispatcher

Delphi declaration
property Dispatcher: TISAPIDispatcher read FDispatcher;
C++ declaration
__property TISAPIDispatcher *Dispatcher={ read=FDispatcher, nodefault }

Description
Use it to call the required Dispatcher methods.

Expires
Expires HTTP header field

Delphi declaration
property Expires: TDateTime read FExpires write FExpires;
C++ declaration
__property System::TDateTime Expires={ read=FExpires, write=FExpires }

Description
Default 0.

Will be sent if > 0.

If evaluated, local time is expected. Before sending, it will automatically be converted into GMT.

HTMLResult
Resulting HTML page text

Delphi declaration
property HTMLResult: TStringList read FHTMLResult write SetHTMLResult;
C++ declaration
__property Classes::TStringList *HTMLResult={ read=FHTMLResult, write=SetHTMLResult, nodefault }

Description
Default is empty. Add your HTML page text there.

For enconding characters and URLs use THTTPCharEncDec encoding methods.

If ResultStream is assigned, it will be sent instead!

LastModified
Last-modified HTTP header field

Delphi declaration
property LastModified: TDateTime read FLastModified write FLastModified;
C++ declaration
__property System::TDateTime LastModified={ read=FLastModified, write=FLastModified }

Description
Default 0.

Will be sent if > 0.

If evaluated, local time is expected. Before sending, it will be converted into GMT.

ResultStream
Result as stream

Delphi declaration
property ResultStream: TStream read FResultStream write SetResultStream;
C++ declaration
__property Classes::TStream *ResultStream={ read=FResultStream, write=SetResultStream, nodefault }

Description
If you assign stream to this variable, it will be sent to the client instead of HTMLResult (don't forget to set right ContentType ).

Stream will be freed automatically after it is sent.

Status
Response status HTTP header field

Delphi declaration
property Status: DWORD read FHttpStatusCode write FHttpStatusCode;
C++ declaration
__property int Status={ read=FHttpStatusCode, write=FHttpStatusCode, nodefault }

Description
Default 200 (all OK).

WWWAuthenticate
WWW-Authenticate HTTP header field

Delphi declaration
property WWWAuthenticate: AnsiString read FWWWAuthenticate write FWWWAuthenticate;
C++ declaration
__property System::AnsiString WWWAuthenticate={ read=FWWWAuthenticate, write=FWWWAuthenticate, nodefault }

Description
Usage depends on the server...