WebHeaderCollection.Remove Method (String)

 

Removes the specified header from the collection.

Namespace:   System.Net
Assembly:  System (in System.dll)

override Remove : 
        name:string -> unit

Parameters

name
Type: System.String

The name of the header to remove from the collection.

Exception Condition
ArgumentNullException

name is nullEmpty.

ArgumentException

name is a restricted header.

-or-

name contains invalid characters.

Remove deletes the specified header from the collection. If the specified header does not exist, the method returns.

The following example uses the Remove method to remove a header from the WebHeaderCollection. After the header is removed, this example prints all existing headers to the screen to prove that it has been removed.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Return to top
Show: