Web.HTTPApp.TWebActionItem.OnAction

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnAction: THTTPMethodEvent read FOnAction write SetOnAction;

C++

__property THTTPMethodEvent OnAction = {read=FOnAction, write=SetOnAction};

Properties

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

Description

Occurs when TWebDispatcher matches the action item to a newly-arrived HTTP request message.

Write an OnAction event handler to respond to HTTP request messages that match the MethodType and PathInfo properties. OnAction occurs immediately after the response message's Content property has been initialized by the action item's Producer property (if Producer is set).

In an OnAction event handler, read Request and perform the requested Method if possible. Set the properties of the Response parameter as appropriate. If the OnAction event handler does not service the response, or if it only partially handles the request and must let another action item finish the response, set the Handled parameter to false.

An OnAction event handler can call the SendRedirect or SendResponse method of Response to send the HTTP response message to the Web client. If the OnAction event handler does not send the response, the Web application will send it after all action items have finished filling in the Response.

Tip: The OnAction event handler can use descendants of TCustomContentProducer to help assemble the contents of the response message.

See Also