             if let dataTaskWillCacheResponse = dataTaskWillCacheResponse {
                 cachedResponse = dataTaskWillCacheResponse(session, dataTask, proposedResponse)
             }
-
+            
             completionHandler(cachedResponse)
         }
     }
 }
-
-// MARK: - CustomStringConvertible
-
-extension Request: CustomStringConvertible {
-
-    /**
-        The textual representation used when written to an output stream, which includes the HTTP method and URL, as
-        well as the response status code if a response has been received.
-    */
-    public var description: String {
-        var components: [String] = []
-
-        if let HTTPMethod = request?.httpMethod {
-            components.append(HTTPMethod)
-        }
-
-        if let URLString = request?.url?.absoluteString {
-            components.append(URLString)
-        }
-
-        if let response = response {
-            components.append("(\(response.statusCode))")
-        }
-
-        return components.joined(separator: " ")
-    }
-}
-
-// MARK: - CustomDebugStringConvertible
-
-extension Request: CustomDebugStringConvertible {
-    func cURLRepresentation() -> String {
-        var components = ["$ curl -i"]
-
-        guard let request = self.request,
-              let URL = request.url,
-              let host = URL.host
-        else {
-            return "$ curl command could not be created"
-        }
-
-        if let httpMethod = request.httpMethod, httpMethod != "GET" {
-            components.append("-X \(httpMethod)")
-        }
-
-        if let credentialStorage = self.session.configuration.urlCredentialStorage {
-            let protectionSpace = URLProtectionSpace(
-                host: host,
-                port: (URL as NSURL).port?.intValue ?? 0,
-                protocol: URL.scheme,
-                realm: host,
-                authenticationMethod: NSURLAuthenticationMethodHTTPBasic
-            )
-
-            if let credentials = credentialStorage.credentials(for: protectionSpace)?.values {
-                for credential in credentials {
-                    components.append("-u \(credential.user!):\(credential.password!)")
-                }
-            } else {
-                if let credential = delegate.credential {
-                    components.append("-u \(credential.user!):\(credential.password!)")
-                }
-            }
-        }
-
-        if session.configuration.httpShouldSetCookies {
-            if let cookieStorage = session.configuration.httpCookieStorage,
-               let cookies = cookieStorage.cookies(for: URL), !cookies.isEmpty
-            {
-                let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value ?? String());" }
-                components.append("-b \"\(string.substring(to: string.characters.index(before: string.endIndex)))\"")
-            }
-        }
-
-        var headers: [NSObject: AnyObject] = [:]
-
-        if let additionalHeaders = session.configuration.httpAdditionalHeaders {
-            for (field, value) in additionalHeaders where field != "Cookie" {
-                headers[field] = value
-            }
-        }
-
-        if let headerFields = request.allHTTPHeaderFields {
-            for (field, value) in headerFields where field != "Cookie" {
-                headers[field] = value
-            }
-        }
-
-        for (field, value) in headers {
-            components.append("-H \"\(field): \(value)\"")
-        }
-
-        if let httpBodyData = request.httpBody,
-           let httpBody = String(data: httpBodyData, encoding: String.Encoding.utf8)
-        {
-            var escapedBody = httpBody.replacingOccurrences(of: "\\\"", with: "\\\\\"")
-            escapedBody = escapedBody.replacingOccurrences(of: "\"", with: "\\\"")
-
-            components.append("-d \"\(escapedBody)\"")
-        }
-
-        components.append("\"\(URL.absoluteString)\"")
-
-        return components.joined(separator: " \\\n\t")
-    }
-
-    /// The textual representation used when written to an output stream, in the form of a cURL command.
-    public var debugDescription: String {
-        return cURLRepresentation()
-    }
-}

*/
public class Request {

    // MARK: - Properties

    /// The delegate for the underlying task.
    public let delegate: TaskDelegate

        private var dataProgress: ((bytesReceived: Int64, totalBytesReceived: Int64, totalBytesExpectedToReceive: Int64) -> Void)?
        private var dataStream: ((data: Data) -> Void)?

        // MARK: Lifecycle

        override init(task: URLSessionTask) {
            mutableData = Data()
            super.init(task: task)
        }

        // MARK: NSURLSessionDataDelegate

        var dataTaskDidReceiveResponse: ((Foundation.URLSession, URLSessionDataTask, URLResponse) -> Foundation.URLSession.ResponseDisposition)?
        var dataTaskDidBecomeDownloadTask: ((Foundation.URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)?
        var dataTaskDidReceiveData: ((Foundation.URLSession, URLSessionDataTask, Data) -> Void)?
        var dataTaskWillCacheResponse: ((Foundation.URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)?

        func urlSession(
            _ session: URLSession,
