Internet Direct (Indy) Version 9.0.2 Beta
TIdHTTP.HandleRedirects
Indicates if the HTTP client can handle redirections to an alternate resource location.

property HandleRedirects: Boolean;
Description
HandleRedirects is a Boolean property that indicates if the HTTP client should handle redirects in a response from the HTTP server. Redirects are indicated by the HTTP Response having a ResponseCode in the range 300 to 307, and requires further action needs by the HTTP Client to fulfill the request.

Redirection ResponseCodes include the following:

HandleRedirects is used with RedirectMaximum in DoRequest to detect and prevent infinite redirection loops, by limiting the number of active redirections for the client to the value specified in RedirectMaximum.

When HandleRedirects is True, the HTTP Client will trigger the OnRedirect event handler to determine if the client can accept the redirection location found in an HTTP response. When accepted, the redirect causes a new HTTP request with the new location to be issued to fulfill the original request.

When HandleRedirects is False, the OnRedirect event handler will be triggered, and an EIdProtocolReplyError exception will be raised when the redirect cannot be handled by the HTTP client.

The default value for HandleRedirects is Id_TIdHTTP_HandleRedirects, as assigned in the Create constuctor.