Skip to main content

HCHttpCallResponseSetDynamicSize

Marks an HTTP call as having a dynamic-size response body for download progress reporting. Use this function when the number of bytes that your response body write function processes differs from the bytes received, and you know that total before the call starts. For example, if your write function decompresses data, you can report progress in decompressed bytes.

Syntax

Parameters

call   _In_
Type: HCCallHandle
The handle of the HTTP call. dynamicBodySize   _In_
Type: uint64_t
The total size, in bytes, to use for progress reporting. Must be greater than 0.

Return value

Type: HRESULT

Remarks

Call this function before HCHttpCallPerformAsync. While the response downloads, report progress by calling HCHttpCallResponseAddDynamicBytesWritten, usually from the custom write function that you set with HCHttpCallResponseSetResponseBodyWriteFunction. If a download progress callback is registered and the response has a positive Content-Length, the built-in WinHTTP provider on Windows and XBOX consoles passes dynamicBodySize and the reported byte count to the callback instead of the network byte counts. Setting a dynamic size doesn’t enable download progress for responses without a positive Content-Length. For the other callback restrictions, see HCHttpCallProgressReportFunction. The reported byte count isn’t reset if libHttpClient retries the call. For details, see HCHttpCallResponseAddDynamicBytesWritten. For the request body, use HCHttpCallRequestSetDynamicSize and HCHttpCallRequestAddDynamicBytesWritten, which are declared in httpClient.h.

Requirements

Header: httpProvider.h Library: libHttpClient.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

See also

httpProvider
HCHttpCallResponseAddDynamicBytesWritten
HCHttpCallResponseGetDynamicBytesWritten
Last modified on October 30, 2026