...
// *****************************
TQueryRequestFullfillerClass = class
// *****************************
constructor Create (var pECB: TEXTENSION_CONTROL_BLOCK);
private
Response: Array[0..MAX_PATH] of Char;
AllParams: TParamStrings;
dwLen: Cardinal;
Page,
QueryString: WideString;
...
public
function SendResponse (var pECB: TEXTENSION_CONTROL_BLOCK): Integer;
end;
// *****************************
THoroscopeRequestFullfillerClass = class (TQueryRequestFullfillerClass)
// *****************************
private
...
public
function ProcessRequest (var pECB: TEXTENSION_CONTROL_BLOCK): Integer;
end;
...
// *****************************
constructor TQueryRequestFullfillerClass.Create (var pECB: TEXTENSION_CONTROL_BLOCK);
// *****************************
begin
if (lstrcmpi (pECB.lpszMethod, 'POST') = 0) then
begin
SetString (QueryString, PChar(pECB.lpbData), pECB.cbTotalBytes);
AllParams := GetAllParams (QueryString);
end;
if (lstrcmpi (pECB.lpszMethod, 'GET') = 0) then
begin
SetString (QueryString, PChar (pECB.lpszQueryString), Length (pECB.lpszQueryString));
AllParams := GetAllParams (QueryString);
end;
Page := '';
end;
// *****************************
function TQueryRequestFullfillerClass.SendResponse (var pECB: TEXTENSION_CONTROL_BLOCK): Integer;
// *****************************
begin
Page := 'Content-Type: text/
html' + #13#10#13#10 + Page;
dwLen := lStrLen (@Page[1]);
lstrcpy (Response, '200 OK');
if pECB.ServerSupportFunction (pECB.ConnID, HSE_REQ_SEND_RESPONSE_HEADER, @Response, @dwLen, @page[1]) then
Result := HSE_STATUS_SUCCESS
else
Result := HSE_STATUS_ERROR;
end;
// *****************************
function THoroscopeRequestFullfillerClass.ProcessRequest (var pECB: TEXTENSION_CONTROL_BLOCK): Integer;
// *****************************
begin
Page := '
[b]Hello World![/b]
';
Result := SendResponse (pECB);
end;