System.Net.WebHeaderCollection.Set Method

Sets the specified header to the specified value.

Syntax

public void Set (HttpResponseHeader header, string value)

Parameters

header
The System.Net.HttpResponseHeader value to set.
value
The content of the header to set.

Remarks

If the header specified in the header does not exist, the WebHeaderCollection.Set(HttpRequestHeader, string) method inserts a new header into the list of header name/value pairs.

If the header specified in header is already present, value replaces the existing value.

Requirements

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