Determines whether the HTTP content has a valid length in bytes.
Assembly: System.Net.Http (in System.Net.Http.dll)
'Declaration Protected Friend MustOverride Function TryComputeLength ( _ <OutAttribute> ByRef length As Long _ ) As Boolean
- Type: System.Int64
The length in bytes of the HTTP content.
The method gives a HTTP content the ability to calculate the content length. This is useful for content types which are able to easily 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.