 
 extension URLResponse {
   var HTTPHeaders: [String: String] {
+    #if os(Linux)
     return (self as? HTTPURLResponse)?.allHeaderFields ?? [:]
+    #else
+    return (self as? HTTPURLResponse)?.allHeaderFields as? [String: String]
+      ?? [:]
+    #endif
   }
 }
 

  public lazy var cookies: [String: HTTPCookie] = {
    let foundCookies: [HTTPCookie]
    if let headers = self.response?.HTTPHeaders, let url = self.response?.url {
      foundCookies = HTTPCookie.cookies(withResponseHeaderFields: headers,
                                        forURL: url) as [HTTPCookie]
    } else {
      foundCookies = []
    }

import Foundation

#if os(Linux)
import Dispatch
#endif

// stolen from python-requests
let statusCodeDescriptions = [
