Headers Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets or sets the collection of header name/value pairs returned by the server.

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

public:
property WebHeaderCollection^ Headers {
	WebHeaderCollection^ get ();
	void set (WebHeaderCollection^ value);
}

Property Value

Type: System.Net..::..WebHeaderCollection
A WebHeaderCollection instance that contains all the explicitly set HTTP headers to be included in the response.

Response headers contain metadata information such as the date and time of the response, the identity of the responding server, and the MIME type of the data contained in the response body.

NoteNote

If you attempt to set a Content-Length, Keep-Alive, Transfer-Encoding, or WWW-Authenticate header using the Headers property, an exception will be thrown. Use the KeepAlive or ContentLength64 properties to set these headers. You cannot set the Transfer-Encoding or WWW-Authenticate headers manually.

Show: