[阅读: 730] 2007-04-12 04:04:00
TIdHTTP.OnRedirect
TIdHTTP
Event handler triggered for redirect requests.
property OnRedirect: TIdHTTPOnRedirectEvent;
Parameters
dest
URL for the new resource location.
Handled
Indicated that redirects should be handled.
NumRedirect
An accumulator for the number of redirection requests.
Sender
Client triggering the event.
VMethod
HTTP method to be used to fulfill the redirect.
Description
OnRedirect is a published TIdHTTPOnRedirectEvent property in TIdHTTP, and represents the event handler signalled 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.
--------------------------------------------------------------------------------
TIdHTTP.OnSelectAuthorization
TIdHTTP
Event handler triggered when the client selects an authentication mechanism for the connection.
property OnSelectAuthorization: TIdOnSelectAuthorization;
Parameters
AuthenticationClass
Authentication class to use for the connection.
AuthInfo
Header values to use in authectication.
Sender
HTTP client generating the event notification.
Description
OnSelectAuthorization is a published TIdOnSelectAuthorization property in TIdHTTP, and represents the event handler triggered when the HTTP client chooses an Authentication method and class for authorizing a connection.
OnSelectAuthorization is triggered when a Request needs Authentication using a supported Authentication method for the WWWAuthenticate headers found in Response. OnSelectAuthorization can be used to set the class instance in Auth used for authenticating the client Request based on header values found in AuthInfo.
OnSelectAuthorization is used prior to triggering the OnAuthorization event handler for the client connection.
--------------------------------------------------------------------------------
TIdHTTP.OnSelectProxyAuthorization
TIdHTTP
Event handler triggered when the client selects an authentication mechanism for the Proxied connection.
property OnSelectProxyAuthorization: TIdOnSelectAuthorization;
Parameters
AuthenticationClass
Authentication class to use for the connection.
AuthInfo
Header values to use in authectication.
Sender
HTTP client generating the event notification.
Description
OnSelectProxyAuthorization is a published TIdOnSelectAuthorization property in TIdHTTP, and represents the event handler triggered when the HTTP client chooses an Authentication method and class for authorizing a Proxied connection.
OnSelectProxyAuthorization is triggered when a Request needs Authentication using a supported Authentication method for the Proxy headers found in Response. OnSelectProxyAuthorization can be used to set the class instance in Auth used for authenticating the client Request based on header values found in AuthInfo.
OnSelectProxyAuthorization is used prior to triggering the OnProxyAuthorization event handler for the client connection.