System.Net.WebHeaderCollection.Add Method

Inserts the specified header with the specified value into the collection.

Syntax

public void Add (HttpRequestHeader header, string value)

Parameters

header
The header to add to the collection.
value
The content of the header.

Remarks

If the specified header does not exist, the WebHeaderCollection.Add(HttpRequestHeader, string) method inserts a new header into the list of header name/value pairs.

If the specified header is already present, value is added to the comma-separated list of values associated with the header.

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0