---
title: URLSession.AsyncBytes
framework: foundation
role: symbol
role_heading: Structure
path: foundation/urlsession/asyncbytes
---

# URLSession.AsyncBytes

An asynchronous sequence of bytes.

## Declaration

```swift
struct AsyncBytes
```

## Topics

### Adapting textual sequences

- [AsyncCharacterSequence](foundation/asynccharactersequence.md)
- [AsyncUnicodeScalarSequence](foundation/asyncunicodescalarsequence.md)
- [AsyncLineSequence](foundation/asynclinesequence.md)

### Accessing the URL session task

- [task](foundation/urlsession/asyncbytes/task.md)

### Structures

- [URLSession.AsyncBytes.Iterator](foundation/urlsession/asyncbytes/iterator.md)

### Type Aliases

- [URLSession.AsyncBytes.AsyncIterator](foundation/urlsession/asyncbytes/asynciterator.md)
- [URLSession.AsyncBytes.Element](foundation/urlsession/asyncbytes/element.md)

## Relationships

### Conforms To

- [AsyncSequence](swift/asyncsequence.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Performing asynchronous transfers

- [bytes(for:delegate:)](foundation/urlsession/bytes(for:delegate:).md)
- [bytes(from:delegate:)](foundation/urlsession/bytes(from:delegate:).md)
- [data(for:delegate:)](foundation/urlsession/data(for:delegate:).md)
- [data(from:delegate:)](foundation/urlsession/data(from:delegate:).md)
- [data(for:)](foundation/urlsession/data(for:).md)
- [data(from:)](foundation/urlsession/data(from:).md)
- [download(for:delegate:)](foundation/urlsession/download(for:delegate:).md)
- [download(from:delegate:)](foundation/urlsession/download(from:delegate:).md)
- [download(resumeFrom:delegate:)](foundation/urlsession/download(resumefrom:delegate:).md)
- [upload(for:from:delegate:)](foundation/urlsession/upload(for:from:delegate:).md)
- [upload(for:fromFile:delegate:)](foundation/urlsession/upload(for:fromfile:delegate:).md)
- [upload(for:from:)](foundation/urlsession/upload(for:from:).md)
- [upload(for:fromFile:)](foundation/urlsession/upload(for:fromfile:).md)
- [URLSessionTaskDelegate](foundation/urlsessiontaskdelegate.md)
