System.Net.HttpWebResponse.Headers Property

Gets the headers that are associated with this response from the server.

Syntax

public override WebHeaderCollection Headers { get; }

Value

A System.Net.WebHeaderCollection containing the header information returned with the response.

Exceptions

TypeReason
ObjectDisposedExceptionThe current instance has been disposed.

Remarks

The HttpWebResponse.Headers property is a collection of name/value pairs that contain the HTTP header values returned with the response. Common header information returned from the Internet resource is exposed as properties of the System.Net.HttpWebResponse class. The following table lists common headers that the API exposes as properties.

Content-Encoding

HttpWebResponse.ContentEncoding

Content-Length

HttpWebResponse.ContentLength

Content-Type

HttpWebResponse.ContentType

Last-Modified

HttpWebResponse.LastModified

Server

HttpWebResponse.Server

Requirements

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