Sign in Join
FPDoc Onlineexperiment

THTTPRouter.RegisterRoute function

Member of THTTPRouterpublicIn unit HTTPRoute

Registers a new route with the router

Declaration

pascal
function RegisterRoute(const APattern: string; AEvent: TRouteEvent; 
 IsDefault: Boolean=False): THTTPRoute; overload
function RegisterRoute(const APattern: string; AMethod: TRouteMethod; 
 AEvent: TRouteEvent; IsDefault: Boolean=False)
: THTTPRoute; overload
function RegisterRoute(const APattern: string; 
 const AIntf: IRouteInterface; 
 IsDefault: Boolean=False): THTTPRoute; overload
function RegisterRoute(const APattern: string; AMethod: TRouteMethod; 
 const AIntf: IRouteInterface; 
 IsDefault: Boolean=False): THTTPRoute; overload
function RegisterRoute(const APattern: string; 
 const AObjectClass: TRouteObjectClass; 
 IsDefault: Boolean=False): THTTPRoute; overload
function RegisterRoute(const APattern: string; AMethod: TRouteMethod; 
 const AobjectClass: TRouteObjectClass; 
 IsDefault: Boolean=False): THTTPRoute; overload
function RegisterRoute(const APattern: string; AData: Pointer; 
 ACallBack: TRouteCallBackEx; 
 IsDefault: Boolean=False): THTTPRoute; overload
function RegisterRoute(const APattern: string; AData: Pointer; 
 AMethod: TRouteMethod; 
 ACallBack: TRouteCallBackEx; 
 IsDefault: Boolean=False): THTTPRoute; overload
function RegisterRoute(const APattern: string; 
 ACallBack: TRouteCallBack; 
 IsDefault: Boolean=False): THTTPRoute; overload
function RegisterRoute(const APattern: string; AMethod: TRouteMethod; 
 ACallBack: TRouteCallBack; 
 IsDefault: Boolean=False): THTTPRoute; overload

Arguments

APattern

URL pattern for the route

AEvent

Event handler for the route

IsDefault

Whether this is a default route

AMethod

HTTP method for the route

AIntf

Interface handler for the route

AObjectClass

Object class handler for the route

AData

User data for extended callbacks

ACallBack

Callback handler for the route

Function result

Newly registered route object

Description

RegisterRoute adds a new route to the router with the specified pattern and handler. It supports various handler types including callbacks, events, interfaces, and object classes.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.