語言

HttpContentHeaders.ContentLength 屬性

定義

取得或設定 HTTP 回應中內容標頭的值 Content-Length 。

public:
 property Nullable<long> ContentLength { Nullable<long> get(); void set(Nullable<long> value); };
public long? ContentLength { get; set; }
member this.ContentLength : Nullable<int64> with get, set
Public Property ContentLength As Nullable(Of Long)

屬性值

HTTP 回應上的內容標頭值 Content-Length 。

例外狀況

該價值從未被設定,且在嘗試計算時標的 HttpContent 資產被處理掉。

備註

若標頭尚未設定,則可依需從緩衝內容或使用 TryComputeLength。

適用於