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

System.Net.WebHeaderCollection.Add Method

Inserts a new header with the specified name and value into the collection. [Edit]

public override void Add (string name, string value)

Parameters

name
A string that contains the name of the header to add to the collection. [Edit]
value
A string that contains the content of the header. [Edit]

Exceptions

TypeReason
ArgumentException

name is null or string.Empty, or contains invalid characters.

-or-

name 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.

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

Note: This method overrides System.Collections.Specialized.NameValueCollection.Add(System.Collections.Specialized.NameValueCollection).

[Edit]

Requirements

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