Structure

URLSession.DataTaskPublisher

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

Declaration

struct DataTaskPublisher

Topics

Declaring Publisher Topography

typealias URLSession.DataTaskPublisher.Output

The kind of values published by this publisher.

typealias URLSession.DataTaskPublisher.Failure

The kind of errors this publisher might publish.

Creating a Data Task Publisher

init(request: URLRequest, session: URLSession)

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

Inspecting Data Task Properties

let request: URLRequest

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

let session: URLSession

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

Instance Methods

Relationships

Conforms To

See Also

Performing Tasks as a Combine Publisher

func dataTaskPublisher(for: URLRequest) -> URLSession.DataTaskPublisher

Returns a publisher that wraps a URL session data task for a given URL request.

func dataTaskPublisher(for: URL) -> URLSession.DataTaskPublisher

Returns a publisher that wraps a URL session data task for a given URL.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software