<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLSession/DataTaskPublisher",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:So12NSURLSessionC10FoundationE17DataTaskPublisherV"
  },
  "title" : "URLSession.DataTaskPublisher"
}
-->

# URLSession.DataTaskPublisher

A publisher that delivers the results of performing URL session data tasks.

```
struct DataTaskPublisher
```

## Topics

### Declaring publisher topography

[`URLSession.DataTaskPublisher.Output`](/documentation/Foundation/URLSession/DataTaskPublisher/Output)

The kind of values published by this publisher.

[`URLSession.DataTaskPublisher.Failure`](/documentation/Foundation/URLSession/DataTaskPublisher/Failure)

The kind of errors this publisher might publish.

### Creating a data task publisher

[`init(request:session:)`](/documentation/Foundation/URLSession/DataTaskPublisher/init(request:session:))

Creates a data task publisher from the provided URL request and URL session.

### Inspecting data task properties

[`request`](/documentation/Foundation/URLSession/DataTaskPublisher/request)

The URL request performed by the data task associated with this publisher.

[`session`](/documentation/Foundation/URLSession/DataTaskPublisher/session)

The URL session that performs the data task associated with this publisher.



---

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)