IROHTTPDispatcher

Overview

This interface specifies the extension for the message dispatcher interface allowing to support HTTP protocol specific features and to build HTTP dispatchers with extended functionality.

This interface is implemented by the TROExtendedHttpDispatcher class. It is unlikely this interface will be used by users, in case the dispatcher functionality needs to be expanded users should rather subclass TROExtendedHttpDispatcher class. The TROHTTPFileDispatcher class is an example of such extension.

Location


Required Methods


Activate

procedure Activate

CanHandlePath

The function should return true if the given path can be handled by the dispatcher.

function CanHandlePath(aPath: string): Boolean

Parameters:

  • aPath: The path to check.

Deactivate

procedure Deactivate

NotifyDispose

This procedure is called when the server HTTP channel is about to be freed.

procedure NotifyDispose

Process

The main method to perform the request processing ant to form the response. Called every time to process incoming requests if the dispatcher is suitable to process it (determined by CanHandlePath result).

procedure Process(aTransport: IROHTTPTransport; aRequest: IROHTTPRequest; aResponse: IROHTTPResponse; aRequestData: TStream; aResponseData: TStream)

Parameters:

  • aTransport: Http transport.
  • aRequest: The structure describing the HTTP request.
  • aResponse: The structure describing the HTTP response, already initialized before the method called.
  • aRequestData: The stream containing additional request data.
  • aResponseData: The stream that should contain additional response data (e.g. content of the requested file), already initialized before the method called..