AlamoFire Session Manager下载中的参数标签不正确下载

编程入门 行业动态 更新时间:2024-10-28 11:26:20
本文介绍了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下载中的参数标签不正确下载

本文发布于:2023-11-26 15:42:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634298.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不正确   参数   标签   AlamoFire   Session

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!