Unit 'HTTPRoute' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#fcl]

THTTPRouter

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

HTTP request router class

Declaration

Source position: httproute.pp line 201

type THTTPRouter = class(TComponent)

public

  constructor Create(); override;

  

Creates a new HTTP router instance

  destructor Destroy; override;

  

Destroys the HTTP router instance

  function FindDefaultRoute();

  

Finds the default route for a method

  procedure DeleteRoute();

  

Removes a route from the collection

  procedure DeleteRouteByID();

  

Removes a route by its ID

  class function SanitizeRoute();

  

Sanitizes a route path string

  class function Service;

  

Returns the global router service instance

  class function ServiceClass;

  

Returns the router service class

  class procedure SetServiceClass();

  

Sets the router service class

  class function StringToRouteMethod();

  

Converts string to route method enumeration

  procedure RegisterInterceptor();

  

Registers a request interceptor

  procedure UnRegisterInterceptor();

  

Removes a request interceptor

  function RegisterRoute();

  

Registers a new route with the router

  function FindHTTPRoute();

  

Finds a route matching path and method

  function GetHTTPRoute();

  

Gets the best matching route for path and method

  procedure RouteRequest();

  

Routes an HTTP request to appropriate handler

  function MoveRouteBeforeDefault();

  

Moves route before default routes

  function MoveRouteBefore();

  

Moves one route before another

  property Routes []: THTTPRoute; default; [r]

  

Provides indexed access to routes

  property RouteCount: Integer; [r]

  

Returns the number of registered routes

  property BeforeRequest: THTTPRouteRequestEvent; [rw]

  

Event triggered before processing requests

  property AfterRequest: THTTPRouteRequestEvent; [rw]

  

Event triggered after processing requests

  property RouteOptions: TRouteOptions; [rw]

  

Global options for route matching

end;

Inheritance

THTTPRouter

  

HTTP request router class

|

TComponent

|

TPersistent,IUnknown,IInterfaceComponentReference

|

TObject,IFPObserved

Description

THTTPRouter provides HTTP request routing functionality for web applications. It manages a collection of routes and matches incoming HTTP requests to appropriate handlers based on URL patterns and HTTP methods.


Documentation generated on: Jan 27 2026