<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLSession/AsyncBytes",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:So12NSURLSessionC10FoundationE10AsyncBytesV"
  },
  "title" : "URLSession.AsyncBytes"
}
-->

# URLSession.AsyncBytes

An asynchronous sequence of bytes.

```
struct AsyncBytes
```

## Topics

### Adapting textual sequences

[`AsyncCharacterSequence`](/documentation/Foundation/AsyncCharacterSequence)

An asynchronous sequence of characters.

[`AsyncUnicodeScalarSequence`](/documentation/Foundation/AsyncUnicodeScalarSequence)

An asychronous sequence of Unicode scalar values.

[`AsyncLineSequence`](/documentation/Foundation/AsyncLineSequence)

An asynchronous sequence of lines of text.

### Accessing the URL session task

[`task`](/documentation/Foundation/URLSession/AsyncBytes/task)

The URL session task that performs the data transfer.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`AsyncSequence`](/documentation/Swift/AsyncSequence)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)