Web.HTTPApp.TWebModule.BeforeDispatch

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property BeforeDispatch: THTTPMethodEvent read FBeforeDispatch write FBeforeDispatch;

C++

__property BeforeDispatch;

Properties

Type Visibility Source Unit Parent
event published
Web.HTTPApp.pas
Web.HTTPApp.hpp
Web.HTTPApp TWebModule

Description

Occurs before the dispatcher tries to match the HTTP request message with any of its action items.

Web.HTTPApp.TWebModule.BeforeDispatch inherits from Web.HTTPApp.TCustomWebDispatcher.BeforeDispatch. All content below this line refers to Web.HTTPApp.TCustomWebDispatcher.BeforeDispatch.

Occurs before the dispatcher tries to match the HTTP request message with any of its action items.

Write a BeforeDispatch event handler to preprocess all HTTP request messages. A BeforeDispatch event handler can enable or disable the action items appropriate to the response, begin filling out the response object, or provide any other necessary preprocessing.

If the BeforeDispatch event handler finishes filling out the response object, it should change the Handled parameter to True so the dispatcher will not send the request on to any of the action items. If the BeforeDispatch event handler sends the response message, the dispatcher will not pass the request on to any of the action items, even if the Handled parameter is left as False.

If the BeforeDispatch event handler sets the Handled parameter to True but does not send the response, the Web dispatcher will generate an AfterDispatch event.

See Also