HttpWorkerRequest.SendCalculatedContentLength 方法
定义
将 Content-LengthHTTP 标头添加到响应。Adds a Content-Length HTTP header to the response.
重载
| SendCalculatedContentLength(Int32) |
将 |
| SendCalculatedContentLength(Int64) |
将 |
SendCalculatedContentLength(Int32)
将 Content-Length HTTP 标头添加到小于或等于 2 GB 的消息正文的响应。Adds a Content-Length HTTP header to the response for message bodies that are less than or equal to 2 GB.
public:
virtual void SendCalculatedContentLength(int contentLength);
public virtual void SendCalculatedContentLength (int contentLength);
abstract member SendCalculatedContentLength : int -> unit
override this.SendCalculatedContentLength : int -> unit
Public Overridable Sub SendCalculatedContentLength (contentLength As Integer)
参数
- contentLength
- Int32
响应的长度(按字节计)。The length of the response, in bytes.
注解
如果未显式设置内容长度,则此方法使实例能够向 HttpWorkerRequest 响应中添加 Content-Length HTTP 标头。When the content length is not explicitly set, this method enables the HttpWorkerRequest instance to add a Content-Length HTTP header to the response.
Content-Length当响应消息正文的长度小于或等于 2 GB 时,使用此重载设置标头。Use this overload to set the Content-Length header when the length of the response message body is less than or equal to 2 GB.
另请参阅
适用于
SendCalculatedContentLength(Int64)
将 Content-Length HTTP 标头添加到大于 2 GB 的消息正文的响应。Adds a Content-Length HTTP header to the response for message bodies that are greater than 2 GB.
public:
virtual void SendCalculatedContentLength(long contentLength);
public virtual void SendCalculatedContentLength (long contentLength);
abstract member SendCalculatedContentLength : int64 -> unit
override this.SendCalculatedContentLength : int64 -> unit
Public Overridable Sub SendCalculatedContentLength (contentLength As Long)
参数
- contentLength
- Int64
响应的长度(按字节计)。The length of the response, in bytes.
注解
如果未显式设置内容长度,则此方法使实例能够向 HttpWorkerRequest 响应中添加 Content-Length HTTP 标头。When the content length is not explicitly set, this method enables the HttpWorkerRequest instance to add a Content-Length HTTP header to the response. 默认实现将调用采用 contentLength 类型为的参数的重载 Int32 。The default implementation calls the overload that takes a contentLength parameter of type Int32.
此重载用于指定大于 2 GB 的消息正文的响应。Use this overload to specify the response for message bodies greater than 2 GB.