HttpRequestHeaderCollection.MaxForwards Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets an integer value that represents the value of a Max-Forwards HTTP header on an HTTP request.
public:
property IReference<unsigned int> ^ MaxForwards { IReference<unsigned int> ^ get(); void set(IReference<unsigned int> ^ value); };
IReference<uint32_t> MaxForwards();
void MaxForwards(IReference<uint32_t> value);
public System.Nullable<uint> MaxForwards { get; set; }
var iReference = httpRequestHeaderCollection.maxForwards;
httpRequestHeaderCollection.maxForwards = iReference;
Public Property MaxForwards As Nullable(Of UInteger)
Property Value
An integer value that represents the value of a Max-Forwards HTTP header on an HTTP request. A null value means that the header is absent.
Remarks
The following sample code shows a method to set the Max-Forwards header on an HttpRequestMessage object using the MaxForwards property on the HttpRequestHeaderCollection object.
public void DemonstrateHeaderRequestMaxForwards() {
var request = new HttpRequestMessage();
// Set the header with an integer.
request.Headers.MaxForwards= 2;
// Get the strong type out
System.Diagnostics.Debug.WriteLine("MaxForwards value: {0}", request.Headers.MaxForwards);
}