---
title: countOfBytesExpectedToReceive
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlsessiontask/countofbytesexpectedtoreceive
---

# countOfBytesExpectedToReceive

The number of bytes that the task expects to receive in the response body.

## Declaration

```swift
var countOfBytesExpectedToReceive: Int64 { get }
```

## Discussion

Discussion This value is determined based on the Content-Length header received from the server. If that header is absent, the value is NSURLSessionTransferSizeUnknown.

## See Also

### Obtaining task progress

- [progress](foundation/urlsessiontask/progress.md)
- [countOfBytesReceived](foundation/urlsessiontask/countofbytesreceived.md)
- [countOfBytesExpectedToSend](foundation/urlsessiontask/countofbytesexpectedtosend.md)
- [countOfBytesSent](foundation/urlsessiontask/countofbytessent.md)
- [NSURLSessionTransferSizeUnknown](foundation/nsurlsessiontransfersizeunknown.md)
