HttpRequestHeaderCollection.MaxForwards Propriedade

Definição

Obtém ou define um valor inteiro que representa o valor de um cabeçalho HTTP Max-Forwards em uma solicitação HTTP.

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)

Valor da propriedade

IReference<UInt32>

Nullable<UInt32>

Windows.Foundation.IReference

IReference<uint32_t>

Um valor inteiro que representa o valor de um cabeçalho HTTP Max-Forwards em uma solicitação HTTP. Um valor nulo significa que o cabeçalho está ausente.

Comentários

O código de exemplo a seguir mostra um método para definir o cabeçalho Max-Forwards em um objeto HttpRequestMessage usando a propriedade MaxForwards no objeto HttpRequestHeaderCollection .

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

Aplica-se a

Confira também