AllowAutoRedirect Property

HttpWebRequest.AllowAutoRedirect Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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.

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

Windows Phone

Use this member when targeting Windows Phone to specify whether the request should follow redirection responses.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft