title: Alamofire Error Domain=NSURLErrorDomain Code=-999 "cancelled"
body: <p>I already have successfully got keychain for my token and passing it to AccessTokenAdapter class shown below.
  http127.0.0.1:8000/api2/projects/?format=json is passed as projectsURL.</p>
  
  <pre><code>    class AccessTokenAdapter: RequestAdapter {
          private let accessToken: String
  
          init(accessToken: String) {
              self.accessToken = accessToken
          }
  
          func adapt(_ urlRequest: URLRequest) throws -&gt; URLRequest {
              var urlRequest = urlRequest
           //   print("JWT \(accessToken)")
              urlRequest.setValue("JWT \(accessToken)", forHTTPHeaderField: "Authorization")
  
              return urlRequest
          }
      }
  
  
      let sessionManager = SessionManager()
      sessionManager.adapter = AccessTokenAdapter(accessToken: self.keychain["token"]!)
  
      sessionManager.request(self.projectsURL, method: .get, encoding: JSONEncoding.default).responseJSON{ response in
          switch response.result {
          case .success:
              print("yey I made it")
          case .failure(let error):
              print(error)
          }
      }
  </code></pre>
  
  <p>however, from print(error), my Xcode shows error like 
  Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLKey=<a href="http://127.0.0.1:8000/api2/projects/?format=json" rel="noreferrer">http://127.0.0.1:8000/api2/projects/?format=json</a>, NSLocalizedDescription=cancelled, NSErrorFailingURLStringKey=http127.0.0.1:8000/api2/projects/?format=json}</p>
  
  <p>Any ideas?<br /> 
  Alamofire 4.0<br />
  Keychain<br />
  Xcode 8.1<br />
  Swift3<br />
  Using JWT for authentication <br />
  Using Postman with header, key = "Authentication", value = "JWT (token generated here)" works fine </p>