Daraja Framework  1.2
HTTP server framework for Object Pascal
TdjWebComponent Class Reference

A base class which can be subclassed to create a HTTP component for a Web site. More...

+ Inheritance diagram for TdjWebComponent:

Public Member Functions

 Service (TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Dispatches client requests to the protected service method. More...
 
- Public Member Functions inherited from TdjGenericWebComponent
 TdjGenericWebComponent ()
 Constructor.
 
 ~TdjGenericWebComponent ()
 Destructor.
 
 Init (const IWebComponentConfig Config)
 Called by the container on startup. More...
 
TIdHTTPSession GetSession (TdjServerContext Context, TdjRequest Request, TdjResponse Response, const Boolean Create=True)
 Get or create a HTTP session. More...
 
IWebComponentConfig GetWebComponentConfig ()
 Returns a IWebComponentConfig object, which contains initialization parameters for this component. More...
 

Protected Member Functions

 OnDelete (TdjRequest Request, TdjResponse Response)
 Called by the server (via the service method) to allow a component to handle a DELETE request.
 
 OnGet (TdjRequest Request, TdjResponse Response)
 Called by the server (via the service method) to allow a component to handle a GET request.
 
 OnHead (TdjRequest Request, TdjResponse Response)
 Called by the server (via the service method) to allow a component to handle a HEAD request.
 
 OnOptions (TdjRequest Request, TdjResponse Response)
 Called by the server (via the service method) to allow a component to handle a OPTIONS request.
 
 OnPost (TdjRequest Request, TdjResponse Response)
 Called by the server (via the service method) to allow a component to handle a POST request.
 
 OnPut (TdjRequest Request, TdjResponse Response)
 Called by the server (via the service method) to allow a component to handle a PUT request.
 
 OnTrace (TdjRequest Request, TdjResponse Response)
 Called by the server (via the service method) to allow a component to handle a TRACE request.
 
 OnPatch (TdjRequest Request, TdjResponse Response)
 Called by the server (via the service method) to allow a component to handle a PATCH request. More...
 
- Protected Member Functions inherited from TdjGenericWebComponent
 Service (TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Handle a HTTP request. More...
 

Additional Inherited Members

- Public Attributes inherited from TdjGenericWebComponent
IWebComponentConfig Config
 

Detailed Description

A base class which can be subclassed to create a HTTP component for a Web site.

A subclass of TdjWebComponent must override at least one method, usually one of these:

  • OnGet, if the web component supports HTTP GET requests
  • OnPost, for HTTP POST requests
  • OnPut, for HTTP PUT requests
  • OnDelete, for HTTP DELETE requests

Member Function Documentation

TdjWebComponent::OnPatch ( TdjRequest  Request,
TdjResponse  Response 
)
protected

Called by the server (via the service method) to allow a component to handle a PATCH request.

See also
http://tools.ietf.org/html/rfc5789
TdjWebComponent::Service ( TdjServerContext  Context,
TdjRequest  Request,
TdjResponse  Response 
)

Dispatches client requests to the protected service method.

Note
a custom Web Component should not override this method.
Parameters
ContextHTTP server context
RequestHTTP request
ResponseHTTP response
Exceptions
EWebComponentExceptionif an exception occurs that interferes with the component's normal operation

Referenced by TdjWebComponentHandler::TdjWebComponentHandler().