System.Net.WebHeaderCollection.Remove Method

Removes the specified header from the collection.

Syntax

public override void Remove (string name)

Parameters

name
The name of the header to remove from the collection.

Exceptions

TypeReason
ArgumentNullException name is null or string.Empty.
ArgumentException

name contains invalid characters.

-or-

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

Remarks

WebHeaderCollection.Remove(HttpRequestHeader) deletes the specified header from the collection. If the specified header does not exist, the method returns.

Requirements

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