> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# HCHttpCallResponseAddDynamicBytesWritten

> Reports bytes written for an HTTP response body that has a dynamic size.

# HCHttpCallResponseAddDynamicBytesWritten

Adds to the number of response body bytes written for an HTTP call that has a dynamic-size response body. libHttpClient uses the total for download progress reports.

## Syntax

```cpp theme={null}
HRESULT HCHttpCallResponseAddDynamicBytesWritten(
         HCCallHandle call,
         uint64_t bytesWritten
)
```

### Parameters

*call*   \_In\_\
Type: HCCallHandle

The handle of the HTTP call.

*bytesWritten*   \_In\_\
Type: uint64\_t

The number of bytes written since the last call. libHttpClient adds this value to the running total.

### Return value

Type: HRESULT

| Value | Meaning |
| - | - |
| S\_OK | The bytes were added. |
| E\_INVALIDARG | `call` is `nullptr`. |
| E\_UNEXPECTED | [HCHttpCallResponseSetDynamicSize](https://docs.xbox.com/reference/live/httpclient/httpprovider/functions/hchttpcallresponsesetdynamicsize.md) wasn't called for this call. |

## Remarks

Call [HCHttpCallResponseSetDynamicSize](https://docs.xbox.com/reference/live/httpclient/httpprovider/functions/hchttpcallresponsesetdynamicsize.md) before you call this function. The response-side size is the prerequisite; `HCHttpCallRequestSetDynamicSize` applies only to the request body.

If the running total exceeds the dynamic size, libHttpClient caps the total at the dynamic size and writes a warning to the trace log.

The running total isn't reset if libHttpClient retries the call. Bytes that you report while processing a retried response are added to the existing total, so progress can reach the dynamic size before the retried response finishes and then stays at that size.

This function doesn't synchronize updates to the running total. If more than one thread reports bytes for the same call, serialize those calls.

## Requirements

**Header:** httpProvider.h

**Library:** libHttpClient.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[httpProvider](https://docs.xbox.com/reference/live/httpclient/httpprovider/httpprovider_members.md)\
[HCHttpCallResponseSetDynamicSize](https://docs.xbox.com/reference/live/httpclient/httpprovider/functions/hchttpcallresponsesetdynamicsize.md)\
[HCHttpCallResponseGetDynamicBytesWritten](https://docs.xbox.com/reference/live/httpclient/httpprovider/functions/hchttpcallresponsegetdynamicbyteswritten.md)


## Related topics

- [HCHttpCallResponseGetDynamicBytesWritten](https://docs.xbox.com/reference/live/httpclient/httpprovider/functions/hchttpcallresponsegetdynamicbyteswritten.md)
- [HCHttpCallResponseSetDynamicSize](https://docs.xbox.com/reference/live/httpclient/httpprovider/functions/hchttpcallresponsesetdynamicsize.md)
- [httpProvider (contents)](https://docs.xbox.com/reference/live/httpclient/httpprovider/httpprovider_members.md)
- [HCHttpCallRequestAddDynamicBytesWritten](https://docs.xbox.com/reference/live/httpclient/httpclient/functions/hchttpcallrequestadddynamicbyteswritten.md)
- [HCHttpCallRequestGetDynamicBytesWritten](https://docs.xbox.com/reference/live/httpclient/httpprovider/functions/hchttpcallrequestgetdynamicbyteswritten.md)
