docs/Structs/DataTask.html
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public struct DataTask<Value> : Sendable where Value : Sendable
Value used to await a DataResponse and associated values.
`
response
` Asynchronous
DataResponse produced by the DataRequest and its response handler.
Swift
public var response: DataResponse<Value, AFError> { get async }
`
result
` Asynchronous
Result of any response serialization performed for the response.
Swift
public var result: Result<Value, AFError> { get async }
`
value
` Asynchronous
Value returned by the response.
Swift
public var value: Value { get async throws }
`
cancel()
`
Cancel the underlying DataRequest and Task.
Swift
public func cancel()
`
resume()
`
Resume the underlying DataRequest.
Swift
public func resume()
`
suspend()
`
Suspend the underlying DataRequest.
Swift
public func suspend()