Mono Class Library: System.Net.WebHeaderCollection Overview | Members

System.Net.WebHeaderCollection.Add Method

Inserts the specified header into the collection. [Edit]

public void Add (string header)

Parameters

header
A string containing the header to add, with the name and value separated by a colon. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionheader is null or string.Empty. [Edit]
ArgumentException

header does not contain a colon (:) character.

-or-

name is string.Empty, or contains invalid characters.

-or-

header is a protected header that can only be set with a property accessor or by the system.

-or-

value contains invalid characters.

[Edit]

Remarks

This method inserts a new header into the list of header name/value pairs. header is required to be specified in the format name:value.

If the header specified in name is already present in the collection, value is concatenated with the existing value.

[Edit]

Requirements

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