AlamoFire's documentation:
let destination: DownloadRequest.DownloadFileDestination = { _, _ in
let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
let fileURL = documentsURL.appendingPathComponent("pig.png")
return (fileURL, [.removePreviousFile, .createIntermediateDirectories])
}
My code:
fileprivate let manager: Alamofire.SessionManager = { ...
let destination: DownloadRequest.DownloadFileDestination = { _, _ in
let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
let fileURL = documentsURL.appendingPathComponent(".mp4")
return (fileURL, [.removePreviousFile, .createIntermediateDirectories])
}
...
self.manager.download(urlString, to: destination) { response in
All you have to do is update the method. You can try to autofill but its unreliable. My guess is the method is this method (which defaults to GET):