---
title: countOfBytesExpectedToSend
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlsessiontask/countofbytesexpectedtosend
---

# countOfBytesExpectedToSend

The number of bytes that the task expects to send in the request body.

## Declaration

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

## Discussion

Discussion The URL loading system can determine the length of the upload data in three ways: From the length of the data object provided as the upload body. From the length of the file on disk provided as the upload body of an upload task (not a download task). From the Content-Length in the request object, if you explicitly set it. Otherwise, the value is NSURLSessionTransferSizeUnknown (-1) if you provided a stream or body data object, or zero (0) if you did not.

## See Also

### Obtaining task progress

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