HttpClient.MaxResponseContentBufferSize HttpClient.MaxResponseContentBufferSize HttpClient.MaxResponseContentBufferSize HttpClient.MaxResponseContentBufferSize Property

定义

获取或设置读取响应内容时要缓冲的最大字节数。Gets or sets the maximum number of bytes to buffer when reading the response content.

public:
 property long MaxResponseContentBufferSize { long get(); void set(long value); };
public long MaxResponseContentBufferSize { get; set; }
member this.MaxResponseContentBufferSize : int64 with get, set
Public Property MaxResponseContentBufferSize As Long

属性值

当读取响应内容时缓冲区的最大字节数。The maximum number of bytes to buffer when reading the response content. 此属性的默认值为 2 GB。The default value for this property is 2 gigabytes.

异常

指定大小小于或等于零。The size specified is less than or equal to zero.

已在当前实例上启动了一个操作。An operation has already been started on the current instance.

已释放当前实例。The current instance has been disposed.

注解

应用程序可以设置MaxResponseContentBufferSize属性设置为较低的值来限制对缓冲区的响应的大小,在读取响应时。An app can set the MaxResponseContentBufferSize property to a lower value to limit the size of the response to buffer when reading the response. 如果响应内容的大小大于MaxResponseContentBufferSize属性,将引发异常。If the size of the response content is greater than the MaxResponseContentBufferSize property, an exception is thrown.

适用于