IHttpContent.TryComputeLength(UInt64) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determines whether the HTTP content has a valid length in bytes.
public:
bool TryComputeLength([Out] unsigned long long & length);
bool TryComputeLength([Out] uint64_t & length);
public bool TryComputeLength(out ulong length);
Public Function TryComputeLength (ByRef length As ULong) As Boolean
- length
-
UInt64
unsigned long long
uint64_t
The length in bytes of the HTTP content.
bool
true if length is a valid length; otherwise, false.
The TryComputeLength method calculates the content length for HTTP content in IHttpContent. This is useful for content types that are easy to calculate the content length.
If computing the content length is not possible or expensive (would require the system to buffer the whole content where the serialization would be expensive or require the system to allocate a lot of memory), this method can return false. If this method returns false, this implies that either chunked transfer is needed or the content must get buffered before being sent to the server.
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |