Internet Direct (Indy) Version 9.0.1 Beta
TIdHTTP.OnRedirect
Event handler triggered for redirect requests.

property OnRedirect: TIdHTTPOnRedirectEvent;
Description
OnRedirect is a TIdHTTPOnRedirectEvent property that represents the event handler used when the HTTP client receives a redirection ResponseCode in the Response for an HTTP Request.

OnRedirect is signalled during handling of an HTTP Response in the DoRequest method when the ResponseCode contains a value in the range 300-307, and the Response contains a Location header.

When HandleRedirects is True, and the number of active redirects does not exceed RedirectMaximum, the event handler is signalled to allow the HTTP client to handle any processing required for the Location, Method, or current number of redirection requests. If the client is not Disconnected, the pending redirection request is automatically executed using a nested call to DoRequest.

When HandleRedirects is False, the event handler is signalled to allow the HTTP client to handle all aspects of the redirection request. If the redirection request is not handled, an EIdProtocolReplyError exception will be raised.

An Application must assign a procedure to the event handler in order to respond to the event notification. The event handler procedure can used to alter the redirection location specified in Dest, or to change the HTTP method for a pending redirection request. The event handler procedure should also set Handled to True to indicate that the redirection request can/should be allowed for the client.