【问题标题】:How to check the host server supports the ResumeData如何检查主机服务器是否支持 ResumeData
【发布时间】:2019-11-11 13:34:58
【问题描述】:

如何检查主机服务器是否支持 ResumeData ?

我有一个文件要从服务器下载并执行暂停和恢复操作,我想知道服务器端是否有任何依赖,它是否支持ResumeDate

如果是,那么我应该如何确认主机服务器支持 ResumeData

谢谢你 您的意见将对我有所帮助。

【问题讨论】:

    标签: ios swift server nsurlsessiondownloadtask


    【解决方案1】:

    可能是这样的

    // 伪代码,我不知道你是怎么解析出来的

    func doesResume() -> Bool {
    
        var truth : Bool = false
    
        if (server.resumeData) {
            truth = true
            print("does support ResumeData")
        } else {
            print("does not support ResumeData")
        }
    
        return truth
    }
    

    你可以使用 Bool 值来测试简历,但你必须重新编码

    server.resumeData 
    

    到您正在使用的任何连接,例如

    Firebase.Auth().auth.resumeData 
    

    ...等

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-07
      • 2020-03-01
      • 2022-12-10
      • 1970-01-01
      相关资源
      最近更新 更多