System.Net.HttpWebRequest.TransferEncoding Property

Gets or sets the value of the Transfer-encoding HTTP header.

Syntax

public string TransferEncoding { get; set; }

Value

A string that contains the value of the HTTP Transfer-encoding header. The default value is null.

Exceptions

TypeReason
InvalidOperationException HttpWebRequest.TransferEncoding is set when HttpWebRequest.SendChunked is false.
ArgumentException HttpWebRequest.TransferEncoding is set to the value "Chunked". This value is case insensitive.

Remarks

Before you can set the HttpWebRequest.TransferEncoding property, you must first set the HttpWebRequest.SendChunked property to true. Clearing HttpWebRequest.TransferEncoding by setting it to null has no effect on the value of HttpWebRequest.SendChunked.

Values assigned to the HttpWebRequest.TransferEncoding property replace any existing contents.

Note:

The value for this property is stored in System.Net.WebHeaderCollection. If WebHeaderCollection is set, the property value is lost.

Requirements

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