HttpRequestHeaderCollection.MaxForwards HttpRequestHeaderCollection.MaxForwards HttpRequestHeaderCollection.MaxForwards HttpRequestHeaderCollection.MaxForwards 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 : IReference<unsigned int> MaxForwards { get; set; }
IReference<uint32_t> MaxForwards();

void MaxForwards(IReference<uint32_t> maxforwards);
public Nullable<uint> MaxForwards { get; set; }
Public ReadWrite Property MaxForwards As Nullable<uint>
var nullable = httpRequestHeaderCollection.maxForwards;
httpRequestHeaderCollection.maxForwards = nullable;

Property Value

Nullable<uint> Nullable<uint> Nullable<uint>

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

See also