This documentation is archived and is not being maintained.

HttpWebRequest.TransferEncoding Property

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

[Visual Basic]
Public Property TransferEncoding As String
public string TransferEncoding {get; set;}
public: __property String* get_TransferEncoding();
public: __property void set_TransferEncoding(String*);
public function get TransferEncoding() : String;
public function set TransferEncoding(String);

Property Value

The value of the Transfer-encoding HTTP header. The default value is a null reference (Nothing in Visual Basic).


Exception Type Condition
InvalidOperationException TransferEncoding is set when SendChunked is false.
ArgumentException TransferEncoding is set to the value "Chunked".


Before you can set the TransferEncoding property, you must first set the SendChunked property to true. Clearing TransferEncoding by setting it to a null reference (Nothing in Visual Basic) has no effect on the value of SendChunked.

Values assigned to the TransferEncoding property replace any existing contents.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

HttpWebRequest Class | HttpWebRequest Members | System.Net Namespace