class URLSessionDataTask: URLSessionDataTask {
private let url: URL
private let data: Data
init(configuration: URLSessionConfiguration = .default, url: URL, data: Data, statusCode: Int, completion: @escaping ) {
self.data = data
self.url = url
}
func execute() {
let response = HTTPURLResponse(url: url, statusCode: statusCode, httpVersion: nil, headerFields: nil)
completion(data, response, nil)
}
I am working some test it is working but I am getting yellow error, How can i fix my code ?, please help me.