HttpWebRequest.DefaultMaximumResponseHeadersLength 屬性

定義

取得或設定 MaximumResponseHeadersLength 屬性的預設值。Gets or sets the default for the MaximumResponseHeadersLength property.

public:
 static property int DefaultMaximumResponseHeadersLength { int get(); void set(int value); };
public static int DefaultMaximumResponseHeadersLength { get; set; }
member this.DefaultMaximumResponseHeadersLength : int with get, set
Public Shared Property DefaultMaximumResponseHeadersLength As Integer

屬性值

Int32

收到的回應標頭的預設最大長度 (以 KB (1024 個位元祖) 為單位)。The length, in kilobytes (1024 bytes), of the default maximum for response headers received. 預設組態檔將這個值設為 64 KB。The default configuration file sets this value to 64 kilobytes.

例外狀況

值不等於 -1 且小於零。The value is not equal to -1 and is less than zero.

備註

回應標頭的長度會收到回應狀態行,以及當做 HTTP 通訊協定一部分接收的任何額外控制字元。The length of the response header received the response status line and any extra control characters that are received as part of HTTP protocol. -1 值表示未在收到的回應標頭上加諸限制;值為0表示所有要求都會失敗。A value of -1 means no limit is imposed on the response headers received; a value of 0 means that all requests fail.

此值也可以在設定檔中變更。This value can also be changed in the configuration file. 藉由 MaximumResponseHeadersLength 在類別的實例上設定屬性,即可覆寫這個屬性的影響 HttpWebRequestThe impact of this property can be overridden by setting the MaximumResponseHeadersLength property on an instance of the HttpWebRequest class.

適用於