本文介绍了AlamoFire Session Manager下载中的参数标签不正确下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
AlamoFire的文档:
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]) }我的代码:
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编译错误:
compile error:
推荐答案所有您需要做的就是更新方法。您可以尝试自动填充,但不可靠。我的猜测是该方法(默认为GET):
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):
self.manager.download(urlString, to: destination).response { (response) in print(response) }更多推荐
AlamoFire Session Manager下载中的参数标签不正确下载
发布评论