HttpWorkerRequest.SendCalculatedContentLength Method

Definition

Adds a Content-Length HTTP header to the response.

Overloads

SendCalculatedContentLength(Int32)

Adds a Content-Length HTTP header to the response for message bodies that are less than or equal to 2 GB.

SendCalculatedContentLength(Int64)

Adds a Content-Length HTTP header to the response for message bodies that are greater than 2 GB.

SendCalculatedContentLength(Int32)

Adds a Content-Length HTTP header to the response for message bodies that are less than or equal to 2 GB.

C#
public virtual void SendCalculatedContentLength(int contentLength);

Parameters

contentLength
Int32

The length of the response, in bytes.

Remarks

When the content length is not explicitly set, this method enables the HttpWorkerRequest instance to add a Content-Length HTTP header to the response.

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.

See also

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SendCalculatedContentLength(Int64)

Adds a Content-Length HTTP header to the response for message bodies that are greater than 2 GB.

C#
public virtual void SendCalculatedContentLength(long contentLength);

Parameters

contentLength
Int64

The length of the response, in bytes.

Remarks

When the content length is not explicitly set, this method enables the HttpWorkerRequest instance to add a Content-Length HTTP header to the response. The default implementation calls the overload that takes a contentLength parameter of type Int32.

Use this overload to specify the response for message bodies greater than 2 GB.

See also

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1