Delen via


HttpRequestHeaderCollection.MaxForwards Property

Definition

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

IReference<UInt32>

Nullable<UInt32>

Windows.Foundation.IReference<unsigned int>

IReference<uint32_t>

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);
}

Applies to

See also