SocketTools .NET Edition

HttpClient.OnRedirect Event

Occurs when the server indicates a resource has been moved.

[Visual Basic]
Public Event OnRedirect As OnRedirectEventHandler
[C#]
public event OnRedirectEventHandler OnRedirect;

Event Data

The event handler receives an argument of type HttpClient.RedirectEventArgs containing data related to this event. The following HttpClient.RedirectEventArgs property provides information specific to this event.

Property Description
Location Gets the location of the redirected resource.

Remarks

The OnRedirect event is generated when the server indicates that the requested resource has been moved to a new location. This new location is typically on the same server, however it may specify another server.

If the AutoRedirect property is set to true, then the class will automatically retrieve the resource from its new location. If the property is set to false, then the application is responsible for handling the redirection.

See Also

HttpClient Class | SocketTools Namespace