HttpWebRequest.MaximumAutomaticRedirections Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the maximum number of redirects that the request follows.

Namespace:   System.Net
Assembly:  System (in System.dll)

member MaximumAutomaticRedirections : int with get, set

Property Value

Type: System.Int32

The maximum number of redirection responses that the request follows. The default value is 50.

Exception Condition
ArgumentException

The value is set to 0 or less.

The MaximumAutomaticRedirections property sets the maximum number of redirections for the request to follow if the AllowAutoRedirect property is true.

The following code example sets the value of this property.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: