Headers Property

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

Specifies a collection of the name/value pairs that make up the HTTP headers.

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

public override WebHeaderCollection Headers { get; set; }

Property Value

Type: System.Net..::..WebHeaderCollection
A WebHeaderCollection that contains the name/value pairs that make up the headers for the HTTP request.

The Headers collection contains the protocol headers associated with the request. The following table lists the HTTP headers that are not stored in the Headers collection but are either set by the system or set by properties or methods.

Header

Set by

Accept

Set by the Accept property.

Connection

Set by the Connection property and KeepAlive property.

Content-Length

Set by the ContentLength property.

Content-Type

Set by the ContentType property.

Expect

Set by the Expect property.

Date

Set by the Date property.

Host

Set by the Host property.

If-Modified-Since

Set by the IfModifiedSince property.

Range

Set by the AddRange method.

Referer

Set by the Referer property.

Transfer-Encoding

Set by the TransferEncoding property (the SendChunked property must be true).

User-Agent

Set by the UserAgent property.

Show: