Share via


ContentLength Property

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

Gets the length of the content returned by the request.

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

Syntax

'Declaration
Public Overrides ReadOnly Property ContentLength As Long
public override long ContentLength { get; }
public:
virtual property long long ContentLength {
    long long get () override;
}
abstract ContentLength : int64 with get
override ContentLength : int64 with get
override function get ContentLength () : long

Property Value

Type: System. . :: . .Int64
The number of bytes returned by the request. Content length does not include header information.

Remarks

The ContentLength property contains the value of the Content-Length header returned with the response. If the Content-Length header is not set in the response, ContentLength is set to the value -1.

.NET Framework Security

See Also

Reference

HttpWebResponse Class

System.Net Namespace