fpHTTP unit
HTTP request handling for web servers
The fphttp unit provides the foundation for handling HTTP requests in web server applications.
It implements content producers, web actions,
and web modules for processing HTTP requests and generating responses.
The idea behind the web module and action architecture is that they process an URL of the following kind:
{BaseURL}/module/action/*
Where the appropriate module is determined by the http router and the correct action is selected by the module. The action's event handler will then be executed.
If your application requires a more flexible URL handling, you may want to register callbacks directly with the HTTP router. If you are looking to generate HTML, then the fpweb unit contains web modules that descend from TCustomHTTPModule but are geared towards generating HTML.
Classes and records
EFPHTTPError | class | Exception for HTTP processing errors |
EWebSessionError | class | Exception for session-related errors |
TCustomHTTPModule | class | Base class for HTTP modules |
TCustomWebAction | class | Base class for web actions |
TCustomWebActions | class | Collection of web actions |
THTTPContentProducer | class | Base class for HTTP content production |
TModuleFactory | class | Factory for managing HTTP modules |
TModuleItem | class | Container for module registration information |
TSessionFactory | class | Factory for managing user sessions |
TSessionHTTPModule | class | HTTP module with session support |
Procedures and functions
RegisterHTTPModule | procedure | Registers an HTTP module with the factory |
SessionFactory | function | Returns the global session factory instance |
Types
TCustomHTTPModuleClass | type | Class reference for HTTP modules |
TGetActionEvent | procedure type | Event for determining action names |
TInitModuleEvent | procedure type | Event for module initialization |
TOnModuleRequest | procedure type | Event for module request handling |
TSessionFactoryClass | type | Class reference for session factories |
TSessionHTTPModuleClass | type | Class reference for session HTTP modules |
TWebActionEvent | procedure type | Event handler for web action processing |
TWebModuleKind | enumeration | Web module creation modes |
Constants
cCSRFVariable | constant |
Resource strings
SErrInvActNoDefaultAction | resource string | Error message for invalid action without default |
SErrNoDefaultAction | resource string | Error message for missing default action |
SErrNoSessionFactoryClass | resource string | Error message for missing session factory class |
SErrNoSessionOutsideRequest | resource string | Error message for session access outside request |
SErrNoSuchAction | resource string | Error message for unknown action |
SErrNosuchModule | resource string | Error message for unknown module |
SErrRequestNotHandled | resource string | Error message for unhandled request |
SErrUnknownAction | resource string | Error message for unrecognized action |
Variables
ModuleFactory | variable | Global HTTP module factory instance |
SessionFactoryClass | variable | Class reference for session factory |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
