title: Alamofire error after Swift 3.0 migration: "Cannot convert value of type '(URL, HTTPURLResponse)-> (URL)' to expected argument type 'Parameters'"?
body: <p>I am currently in the process of updating my codebase to Swift 3.0., and I am using Alamofire.  I had to update Alamofire to 4.0 (<a href="https://github.com/Alamofire/Alamofire" rel="nofollow noreferrer">Alamofire git repo</a>).  I have a method to download media (video), and before migration it worked wonderfully.  After using Xcode's migration tool I ended up with this error: "Cannot convert value of type '(URL, HTTPURLResponse)-> (URL)' to expected argument type 'Parameters?', which is a [String: Any].  What exactly is this Parameters object and why is it throwing an error? The only difference between this code before migration and now is that now NSURL is replaced by URL. Any help would be wonderful, as I have been stuck on this for the past 3 hours.</p>
  
  <pre><code>let mediaSourceURI: String = media.sourceURI
  var filePath: URL?
  let destination: (URL, HTTPURLResponse) -&gt; (URL) = {
      (temporaryURL, response) in
  
      if let directoryURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first, let suggestedFilename = response.suggestedFilename {
          filePath = directoryURL.appendingPathComponent("\(suggestedFilename)")
          return filePath!
      }
      return temporaryURL
  }
  
  //ERROR BELOW:  "destination" is highlighted, and says "Cannot convert value of type '(URL, HTTPURLResponse)-&gt; (URL)' to expected argument type 'Parameters?"
  RequestManager.mediaDownloadAlamofireManager.download(mediaSourceURI, method: .get, parameters: destination).response {
      (request, response, data, error) -&gt; Void in
  
      self.completeOperation()
  
  }
  </code></pre>
  
  <p>Here is a link I have been trying to use for reference: <a href="https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%204.0%20Migration%20Guide.md#parameter-encoding-protocol" rel="nofollow noreferrer">Alamofire 4.0 Migration Guide</a>, particularly in the Parameter Encoding Protocol section.  </p>
  
  <p>Here is the syntax of the updated download method in Alamofire:
  <a href="https://i.stack.imgur.com/fxlKA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fxlKA.png" alt="enter image description here"></a></p>
  
  <p>//mediaDownloadAlamofireManager code, which has no errors:</p>
  
  <pre><code>static let mediaDownloadAlamofireManager: SessionManager = {
      let configuration = URLSessionConfiguration.default
      configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders
      let serverTrustPolicies: [String: ServerTrustPolicy] = [baseURL : .disableEvaluation]
      let manager = SessionManager(
          configuration: configuration,
          serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies)
      )
      return manager
  }()
  </code></pre>