Platoo ISAPI ComponentsTFRISAPIRequest

Contents - Methods - Properties

ISAPI request parameters incapsulation


Description
Created by TISAPIApp for every incoming request.


TFRISAPIRequest - Methods

Contents - TFRISAPIRequest - Properties

~TFRISAPIRequest
Destructor

C++ declaration
__fastcall virtual ~TFRISAPIRequest(void)

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

Create
Constructor

Delphi declaration
constructor Create(pECB: PEXTENSION_CONTROL_BLOCK);

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

CreateCookiesList
Delphi declaration
procedure CreateCookiesList;
C++ declaration
void __fastcall CreateCookiesList(void)
CreateParamsList
Delphi declaration
procedure CreateParamsList;
C++ declaration
void __fastcall CreateParamsList(void)
CreatePathList
Delphi declaration
procedure CreatePathList;
C++ declaration
void __fastcall CreatePathList(void)
Destroy
Destructor

Delphi declaration
destructor Destroy;

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

GetCookieByName
Delphi declaration
function GetCookieByName(CookieName: AnsiString): AnsiString;
C++ declaration
System::AnsiString __fastcall GetCookieByName(System::AnsiString CookieName)
GetCookiesList
Delphi declaration
function GetCookiesList: TStringList;
C++ declaration
Classes::TStringList *__fastcall GetCookiesList(void)
GetCookieValuesList
Delphi declaration
function GetCookieValuesList(sCookieName: AnsiString): TStringList;
C++ declaration
Classes::TStringList *__fastcall GetCookieValuesList(System::AnsiString sCookieName)
GetHttpMethod
Delphi declaration
function GetHttpMethod: AnsiString;
C++ declaration
System::AnsiString __fastcall GetHttpMethod(void)
GetParamNameValuesList
Delphi declaration
function GetParamNameValuesList(slSource: TStringList; ParamName: AnsiString): TStringList;
C++ declaration
Classes::TStringList *__fastcall GetParamNameValuesList(Classes::TStringList *slSource, System::AnsiString ParamName)
GetParamsList
Delphi declaration
function GetParamsList: TStringList;
C++ declaration
Classes::TStringList *__fastcall GetParamsList(void)
GetPathInfo
Delphi declaration
function GetPathInfo: AnsiString;
C++ declaration
System::AnsiString __fastcall GetPathInfo(void)
GetPathList
Delphi declaration
function GetPathList: TStringList;
C++ declaration
Classes::TStringList *__fastcall GetPathList(void)
GetQueryParamByName
Delphi declaration
function GetQueryParamByName(ParamName: AnsiString): AnsiString;
C++ declaration
System::AnsiString __fastcall GetQueryParamByName(System::AnsiString ParamName)
GetQueryParamValuesList
Delphi declaration
function GetQueryParamValuesList(ParamName: AnsiString): TStringList;
C++ declaration
Classes::TStringList *__fastcall GetQueryParamValuesList(System::AnsiString ParamName)
GetServerVariable
Delphi declaration
function GetServerVariable(sVariableName: AnsiString): AnsiString;
C++ declaration
System::AnsiString __fastcall GetServerVariable(System::AnsiString sVariableName)
HttpDecodeURLEncoded
Delphi declaration
function HttpDecodeURLEncoded(sSource: AnsiString): AnsiString;
C++ declaration
System::AnsiString __fastcall HttpDecodeURLEncoded(System::AnsiString sSource)
HttpParseVariables
Delphi declaration
procedure HttpParseVariables(sSource: AnsiString; KeyList: TStringList; cSeparator: Char; bTrimLeft: Boolean);
C++ declaration
void __fastcall HttpParseVariables(System::AnsiString sSource, Classes::TStringList *KeyList, char cSeparator, bool bTrimLeft)
Lock
Locking before a thread-unsafe operation

Delphi declaration
procedure Lock;
C++ declaration
void __fastcall Lock(void)

Description
Must always call UnLock to release the lock.

The preferred method is TFRISAPIApp.Lock, because this lock will automatically be freed in case of exceptions.

Actually, this is a shortcut to TFRISAPIApp.Lock, plus IsLocked flag is set.

MapURLToPath
Translate URL to local physical path (calls ISAPI server function HSE_REQUEST_MAP_URL_TO_PATH)

Delphi declaration
function MapURLToPath(const sURL: string): string;
C++ declaration
System::AnsiString __fastcall MapURLToPath(const System::AnsiString sURL)

Description
For example: URL '/scripts/myisapi1.dll',

may result in something like 'C:myisapi1.dll'.

Depends on the server!

TFRISAPIRequest
Constructor

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

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

UnLock
Unlocking after a thread-unsafe operation

Delphi declaration
procedure UnLock;
C++ declaration
void __fastcall UnLock(void)

Description
Flag IsLocked will be set to FALSE as well.

WriteLog
Write string to logfile

Delphi declaration
function WriteLog(LogString: AnsiString): Boolean;
C++ declaration
bool __fastcall WriteLog(System::AnsiString LogString)

Description
For debugging purposes.

WriteLogEx
Write exception class name and error text to logfile

Delphi declaration
function WriteLogEx(E: Exception): Boolean;
C++ declaration
bool __fastcall WriteLogEx(Sysutils::Exception *E)

Description
For debugging purposes.


TFRISAPIRequest - Properties

Contents - TFRISAPIRequest - Methods

CookiesList
Request cookies list

Delphi declaration
property CookiesList: TStringList read GetCookiesList;
C++ declaration
__property Classes::TStringList *CookiesList={ read=GetCookiesList, nodefault }

Description
Contains recieved cookies in the form <CookieName>=<CookieValue>, extracted from the server variable 'HTTP_COOKIE'.

CookieValue
Request cookie value by name

Delphi declaration
property CookieValue[CookieName: AnsiString]: AnsiString read GetCookieByName;
C++ declaration
__property System::AnsiString CookieValue[System::AnsiString CookieName]={ read=GetCookieByName }

Description
Extracts the cookie value from the cookies list.

CookieValues
Request cookie values list by cookie name

Delphi declaration
property CookieValues[sCookieName: AnsiString]: TStringList read GetCookieValuesList;
C++ declaration
__property Classes::TStringList *CookieValues[System::AnsiString sCookieName]={ read=GetCookieValuesList }

Description
Usable in case multiple cookies may have the same name.

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.

ECB
ISAPI Extension Control Block of the current request

Delphi declaration
property ECB: PEXTENSION_CONTROL_BLOCK read FECB;
C++ declaration
__property Isapi::PEXTENSION_CONTROL_BLOCK ECB={ read=FECB, nodefault }

Description
From server.

Handled
Request handled

Delphi declaration
property Handled: Boolean read FHandled write FHandled;
C++ declaration
__property bool Handled={ read=FHandled, write=FHandled, nodefault }

Description
Shows that the request is handled.

Default FALSE.

HttpMethod
Request method

Delphi declaration
property HttpMethod: AnsiString read GetHttpMethod;
C++ declaration
__property System::AnsiString HttpMethod={ read=GetHttpMethod, nodefault }

Description
Value is taken from the ECB.lpszMethod.

Can be 'GET', 'POST', 'HEAD' etc.

IsLocked
Shows that this request runs currently in a locked state

Delphi declaration
property IsLocked: Boolean read FLocked;
C++ declaration
__property bool IsLocked={ read=FLocked, nodefault }

Description
Internally used in exception handling for unlock.

ParamsList
Request params list

Delphi declaration
property ParamsList: TStringList read GetParamsList;
C++ declaration
__property Classes::TStringList *ParamsList={ read=GetParamsList, nodefault }

Description
Contains request parameters in the form <ParamName>=<ParamValue>.

Params are extracted from ECB.lpbData (if HTTPMethod is 'POST') or from ECB.lpszQueryString ('GET', 'HEAD').

For example, URL 'http://www.myserver.net/scripts/myisapi1.dll/abc/def?Param1=Hello&Param2=1':

then ParamsList->Strings[0] = 'Param1=Hello' and ParamsList->Strings[1] = 'Param2=1'.

PathInfo
Request pathinfo

Delphi declaration
property PathInfo: AnsiString read GetPathInfo;
C++ declaration
__property System::AnsiString PathInfo={ read=GetPathInfo, nodefault }

Description
Value is taken from ECB.lpszPathInfo.

For example: URL 'http://www.myserver.net/scripts/myisapi1.dll/abc/def?Param1=Hello&Param2=1',

then PathInfo = '/abc/def'.

PathList
Request subpaths list

Delphi declaration
property PathList: TStringList read GetPathList;
C++ declaration
__property Classes::TStringList *PathList={ read=GetPathList, nodefault }

Description
Contains subpaths list extracted from PathInfo.

PathList->Strings[0] used by the dispatcher to find appropriate actionitem.

For example, URL 'http://www.myserver.net/scripts/myisapi1.dll/abc/def?Param1=Hello&Param2=1':

then PathList->Strings[0] = 'abc' and PathList->Strings[1] = 'def'.

QueryParam
Request parameter value by parameter name

Delphi declaration
property QueryParam[ParamName: AnsiString]: AnsiString read GetQueryParamByName;
C++ declaration
__property System::AnsiString QueryParam[System::AnsiString ParamName]={ read=GetQueryParamByName }

Description
Extracts the parameter value from ParamsList.

QueryParams
Request parameter values list by parameter name

Delphi declaration
property QueryParams[ParamName: AnsiString]: TStringList read GetQueryParamValuesList;
C++ declaration
__property Classes::TStringList *QueryParams[System::AnsiString ParamName]={ read=GetQueryParamValuesList }

Description
Usable if multiple parameters have the same name.

ServerVariable
Getting server variable value by variable name

Delphi declaration
property ServerVariable[sVariableName: AnsiString]: AnsiString read GetServerVariable;
C++ declaration
__property System::AnsiString ServerVariable[System::AnsiString sVariableName]={ read=GetServerVariable }

Description
Parameter 'SCRIPT_NAME' returns URL to this DLL.

Example: URL 'http://www.myserver.net/scripts/myisapi1.dll/abc/def?Param1=Hello&Param2=1',

'SCRIPT_NAME' = '/scripts/myisapi1.dll'

Results may vary depending on the server.