From RAD Studio API Documentation
Jump to: navigation, search


property OnAction: THTTPMethodEvent read FOnAction write SetOnAction;


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


Type Visibility Source Unit Parent
event published
Web.HTTPApp TWebActionItem


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