Editare

Partajați prin


WebHeaderCollection.Item[] Property

Definition

Gets or sets the specified header.

Overloads

Item[HttpRequestHeader]

Gets or sets the specified request header.

Item[HttpResponseHeader]

Gets or sets the specified response header.

Item[String]

Item[HttpRequestHeader]

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

Gets or sets the specified request header.

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

Parameters

header
HttpRequestHeader

The request header value.

Property Value

A String instance containing the specified header value.

Exceptions

This WebHeaderCollection instance does not allow instances of HttpRequestHeader.

Applies to

Item[HttpResponseHeader]

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

Gets or sets the specified response header.

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

Parameters

header
HttpResponseHeader

The response header value.

Property Value

A String instance containing the specified header.

Exceptions

.NET Framework and .NET Core versions 2.0 - 3.1 only: The length of value is greater than 65535.

This WebHeaderCollection instance does not allow instances of HttpResponseHeader.

Remarks

Note

The length of value is validated only in .NET Framework and .NET Core versions 2.0 - 3.1.

Applies to

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

Parameters

name
String

Property Value

Applies to