Removes the specified header from the current instance.
- name
- A string that contains the name of the header to remove from the current instance.
Type Reason 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.
This method deletes the specified header from the current instance. If multiple values were added to the same header using WebHeaderCollection.Add(string, string), a single call to WebHeaderCollection.Remove(string) deletes all of the values.
Note: This method overrides System.Collections.Specialized.NameValueCollection.Remove(string).
Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0