Mono Class Library: System.Net.HttpWebResponse Overview | Members

System.Net.HttpWebResponse.ContentLength Property

Gets the content length of the response data being received.

public override long ContentLength { get; }

Value

A long containing the number of bytes returned from the Internet resource. This value does not include header information.

Exceptions

TypeReason
ObjectDisposedExceptionThe current instance has been disposed.

Remarks

This property is read-only.

The HttpWebResponse.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, HttpWebResponse.ContentLength is set to the value -1.

Note: This property overrides WebResponse.ContentLength .

Requirements

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