System.Net.WebResponse.Headers Property

When overridden in a derived class, gets a collection of header name-value pairs associated with this request.

Syntax

public virtual WebHeaderCollection Headers { get; }

Value

A System.Net.WebHeaderCollection containing the header name/value pairs associated with the current instance.

Exceptions

TypeReason
NotSupportedExceptionThis property is not implemented in the derived class.

Remarks

The WebResponse.Headers property contains the name-value header pairs returned in the response.

Note:

The System.Net.WebResponse class is an abstract class. The actual behavior of System.Net.WebResponse instances at run time is determined by the descendant class returned by WebRequest.GetResponse. For more information about default values and exceptions, please see the documentation for the descendant classes, such as System.Net.HttpWebResponse and System.Net.FileWebResponse.

Requirements

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