Export (0) Print
Expand All
3 out of 4 rated this helpful - Rate this topic

HttpWebRequest.AllowAutoRedirect Property

Gets or sets a value that indicates whether the request should follow redirection responses.

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)
public virtual bool AllowAutoRedirect { get; set; }

Property Value

Type: System.Boolean
true if the request should automatically follow redirection responses from the Internet resource; otherwise false. The default is true.
ExceptionCondition
NotImplementedException

This property is not implemented.

Set AllowAutoRedirect to true if you want the request to automatically follow HTTP redirection headers to the new location of the resource.

The Authorization header is cleared on auto-redirects and HttpWebRequest automatically tries to re-authenticate to the redirected location. In practice, this means that an application can't put custom authentication information into the Authorization header if it is possible to encounter redirection.

The AllowAutoRedirect property is supported by both the browser and the client HTTP stack.

If the application creates a class which derives from HttpWebRequest and does not override the AllowAutoRedirect property and then tries to get or set the AllowAutoRedirect property, a NotImplementedException is thrown.

Version Notes

Silverlight for the desktop

Do not use this member when targeting Silverlight 4.

Silverlight for Windows Phone Silverlight for Windows Phone

You can use this member when targeting Silverlight for Windows Phone to specify whether the request should follow redirection responses.

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.