---
title: countOfBytesSent
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlsessiontask/countofbytessent
---

# countOfBytesSent

The number of bytes that the task has sent to the server in the request body.

## Declaration

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

## Discussion

Discussion This byte count includes only the length of the request body itself, not the request headers. To be notified when this value changes, implement the urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:) delegate method.

## See Also

### Obtaining task progress

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