WebHeaderCollection.Item[] Proprietà

Definizione

Ottiene o imposta l'intestazione specificata.

Overload

Item[HttpRequestHeader]

Ottiene o imposta l'intestazione della richiesta specificata.

Item[HttpResponseHeader]

Ottiene o imposta l'intestazione della risposta specificata.

Item[String]

Item[HttpRequestHeader]

Source:
WebHeaderCollection.cs
Source:
WebHeaderCollection.cs
Source:
WebHeaderCollection.cs

Ottiene o imposta l'intestazione della richiesta specificata.

public:
 property System::String ^ default[System::Net::HttpRequestHeader] { System::String ^ get(System::Net::HttpRequestHeader header); void set(System::Net::HttpRequestHeader header, System::String ^ value); };
public string this[System.Net.HttpRequestHeader header] { get; set; }
public string? this[System.Net.HttpRequestHeader header] { get; set; }
member this.Item(System.Net.HttpRequestHeader) : string with get, set
Default Public Property Item(header As HttpRequestHeader) As String

Parametri

header
HttpRequestHeader

Valore dell'intestazione della richiesta.

Valore della proprietà

Istanza di String contenente il valore di intestazione specificato.

Eccezioni

Questa istanza WebHeaderCollection non consente istanze di HttpRequestHeader.

Si applica a

Item[HttpResponseHeader]

Source:
WebHeaderCollection.cs
Source:
WebHeaderCollection.cs
Source:
WebHeaderCollection.cs

Ottiene o imposta l'intestazione della risposta specificata.

public:
 property System::String ^ default[System::Net::HttpResponseHeader] { System::String ^ get(System::Net::HttpResponseHeader header); void set(System::Net::HttpResponseHeader header, System::String ^ value); };
public string this[System.Net.HttpResponseHeader header] { get; set; }
public string? this[System.Net.HttpResponseHeader header] { get; set; }
member this.Item(System.Net.HttpResponseHeader) : string with get, set
Default Public Property Item(header As HttpResponseHeader) As String

Parametri

header
HttpResponseHeader

Valore dell'intestazione della risposta.

Valore della proprietà

Istanza di String contenente l'intestazione specificata.

Eccezioni

Solo .NET Framework e .NET Core versioni 2.0 - 3.1: la lunghezza di value è maggiore di 65535 caratteri.

Questa istanza WebHeaderCollection non consente istanze di HttpResponseHeader.

Commenti

Nota

La lunghezza di value viene convalidata solo in .NET Framework e .NET Core versioni 2.0 - 3.1.

Si applica a

Item[String]

public:
 property System::String ^ default[System::String ^] { System::String ^ get(System::String ^ name); void set(System::String ^ name, System::String ^ value); };
public string this[string name] { get; set; }
member this.Item(string) : string with get, set
Default Public Property Item(name As String) As String

Parametri

name
String

Valore della proprietà

Si applica a