HTTPRoute unit
HTTP request routing implementation
The HttpRoute unit provides HTTP request routing functionality for web applications.
It defines the THTTPRouter class, which allows mapping URL patterns to specific handlers
based on HTTP methods and path patterns, with support for callbacks, events, objects, and interfaces as route handlers.
A global instance of the router is available in HTTPRouter, this is where you must register your routes: the rest of the FPC web framework uses this global instance to determine where to route requests to.
Classes and records
EHTTPRoute | class | HTTP routing exception class |
IRouteInterface | interface | Interface for route request handlers |
THTTPRoute | class | Base HTTP route class |
THTTPRouteCallback | class | Route with callback procedure handler |
THTTPRouteCallbackEx | class | Route with extended callback handler |
THTTPRouteEvent | class | Route with object event handler |
THTTPRouteInterface | class | Route with interface-based handler |
THTTPRouteList | class | Collection of HTTP routes |
THTTPRouteObject | class | Route with object class handler |
THTTPRouter | class | HTTP request router class |
TRequestInterceptorItem | class | Single request interceptor definition |
TRequestInterceptorList | class | Collection of request interceptors |
TRouteObject | class | Base class for route handler objects |
Procedures and functions
HTTPRouter | function | Returns the global HTTP router instance |
RouteMethodToString | function | Converts route method enumeration to string |
Types
THTTPRouteClass | type | Class reference type for HTTP route |
THTTPRouterClass | type | Class reference type for HTTP router |
THTTPRouteRequestEvent | procedure type | Event type for HTTP route requests |
TInterceptAt | enumeration | Timing enumeration for request interception |
TRequestInterceptEvent | procedure type | Event type for request interception |
TRouteCallBack | procedure type | Procedure type for route callback handlers |
TRouteCallBackEx | procedure type | Extended callback procedure type with user data |
TRouteEvent | procedure type | Event type for route handlers |
TRouteMethod | enumeration | HTTP method enumeration for routing |
TRouteObjectClass | type | Class reference type for route objects |
TRouteOption | enumeration | Route matching options enumeration |
TRouteOptions | set | Set of route matching options |
Constants
RouteMethodNames | constant | Array constant containing HTTP method name strings |
Topics
HttpRouterAdvancedHandlers | topic | Advanced HTTP Router Handler Examples |
HttpRouterBasicUsage | topic | Basic HTTP Router Usage |
HttpRouterHandlerTypes | topic | HTTP Router Handler Types |
HttpRouterInterceptors | topic | HTTP Router Interceptors and Middleware |
HttpRouterMethods | topic | HTTP Router Methods and RESTful APIs |
HttpRouterParameters | topic | HTTP Router Parameterized Routes |
HttpRouterPrinciple | topic | HTTP Router Working Principle |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
