|
Daraja HTTP Framework 3.0.7-SNAPSHOT
HTTP server framework for Object Pascal
|
A base class which can be subclassed to create a HTTP component for a Web site. More...
Public Member Functions | |
| TdjWebComponent () | |
| ~TdjWebComponent () | |
| TIdHTTPSession | GetSession (TdjServerContext Context, TdjRequest Request, TdjResponse Response, const Boolean Create=True) |
| Get or create a HTTP session. | |
| IWebComponentConfig | GetWebComponentConfig () |
| Returns a IWebComponentConfig object, which contains initialization parameters for this component. | |
| Init () | |
| A convenience method which can be overridden so that there is no need to call inherited Init(config). | |
| Init (const IWebComponentConfig Config) | |
| Called by the container on startup. | |
| Service (TdjServerContext Context, TdjRequest Request, TdjResponse Response) | |
| Handle a HTTP request. | |
Public Attributes | |
| IWebComponentConfig | Config |
Protected Member Functions | |
| OnDelete (TdjRequest Request, TdjResponse Response) | |
| Called by the server 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. | |
| TDateTime | OnGetLastModified (TdjRequest Request) |
| Returns the time the WebComponent object was last modified. | |
| 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. | |
| OnPatch (TdjRequest Request, TdjResponse Response) | |
| Called by the server to handle a PATCH request. | |
| OnPost (TdjRequest Request, TdjResponse Response) | |
| Called by the server to handle a POST request. | |
| OnPut (TdjRequest Request, TdjResponse Response) | |
| Called by the server to handle a PUT request. | |
| OnTrace (TdjRequest Request, TdjResponse Response) | |
| Called by the server to handle a TRACE request. | |
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:
| TdjWebComponent::TdjWebComponent | ( | ) |
References TdjWebComponent().
Referenced by TdjWebComponent(), ~TdjWebComponent(), OnGetLastModified(), OnPatch(), and Service().
| TdjWebComponent::~TdjWebComponent | ( | ) |
References TdjWebComponent().
|
inherited |
Get or create a HTTP session.
| Context | HTTP server context |
| Request | HTTP request |
| Response | HTTP response |
| Create | if True, create a session if no one exists |
|
inherited |
Returns a IWebComponentConfig object, which contains initialization parameters for this component.
| EWebComponentException | if the method is called before the component has been initialized. |
Implements IWebComponent.
|
inherited |
A convenience method which can be overridden so that there is no need to call inherited Init(config).
|
inherited |
Called by the container on startup.
| Config | the configuration |
| EWebComponentException | if initialization failed |
Implements IWebComponent.
Referenced by ~TdjGenericWebComponent().
|
protected |
Called by the server to handle a DELETE request.
| Request | The HTTP request to process |
| Response | The HTTP response to fill |
| EWebComponentException | if an exception occurs |
|
protected |
Called by the server (via the service method) to allow a component to handle a GET request.
|
protected |
Returns the time the WebComponent object was last modified.
If the time is unknown, this method returns 0 (the default).
WebComponents that support HTTP GET requests and can quickly determine their last modification time should override this method. This makes browser and proxy caches work more effectively, reducing the load on server and network resources.
| Request | HTTP request |
References TdjWebComponent().
|
protected |
Called by the server (via the service method) to allow a component to handle a HEAD request.
|
protected |
Called by the server (via the service method) to allow a component to handle a OPTIONS request.
|
protected |
Called by the server to handle a PATCH request.
| Request | The HTTP request to process |
| Response | The HTTP response to fill |
| EWebComponentException | if an exception occurs |
References TdjWebComponent().
Referenced by OnPost().
|
protected |
Called by the server to handle a POST request.
| Request | The HTTP request to process |
| Response | The HTTP response to fill |
| EWebComponentException | if an exception occurs |
References OnPatch().
|
protected |
Called by the server to handle a PUT request.
| Request | The HTTP request to process |
| Response | The HTTP response to fill |
| EWebComponentException | if an exception occurs |
|
protected |
Called by the server to handle a TRACE request.
| Request | The HTTP request to process |
| Response | The HTTP response to fill |
| EWebComponentException | if an exception occurs |
| TdjWebComponent::Service | ( | TdjServerContext | Context, |
| TdjRequest | Request, | ||
| TdjResponse | Response ) |
Handle a HTTP request.
The status code of the response always should be set for a component that throws or sends an error.
| Context | HTTP server context |
| Request | HTTP request |
| Response | HTTP response |
| EWebComponentException | if an exception occurs that interferes with the component's normal operation |
Implements IWebComponent.
References TdjWebComponent().
|
inherited |
Referenced by ~TdjGenericWebComponent().