URLSession
extension URLSession: NetworkAccess
Adds conformens to NetworkAccess. URLSession can be used as a network access.
-
Fetches a request asynchrony from remote location.
Declaration
Swift
public func load(request: URLRequest, callback: @escaping (Data?, HTTPURLResponse?, Error?) -> Void) -> NetworkTaskParameters
requestThe request you want to fetch.
callbackCallback which gets called when the request finishes.
Return Value
the running network task
View on GitHub
URLSession Extension Reference