URLSession
extension URLSession
-
Undocumented
Declaration
Swift
public typealias DataResponse = (data: Data, response: URLResponse)
-
Returns a future that wraps a URL session data task for a given URL.
Declaration
Swift
@inlinable public func dataTaskFuture(for url: URL) -> CoFuture<DataResponse>
Parameters
url
The URL for which to create a data task.
Return Value
CoFuture
with future data task result. -
Returns a future that wraps a URL session data task for a given URL request.
Declaration
Swift
public func dataTaskFuture(for urlRequest: URLRequest) -> CoFuture<DataResponse>
Parameters
urlRequest
The URL request for which to create a data task.
Return Value
CoFuture
with future data task result.