Protocol
URLSessionProtocol
public protocol URLSessionProtocol
Define requirements for URLSession
s here for dependency-injection purposes (specifically, for testing).
Requirements
DataTaskResult
typealias DataTaskResult = (Data?, URLResponse?, Error?) -> Void
dataTask(with:completionHandler:)
func dataTask(with request: URLRequest, completionHandler: @escaping DataTaskResult) -> URLSessionDataTaskProtocol