gpt4 book ai didi

ios - Alamofire 4.0.0 : [String:String] is not convertible to [String : Any] & Request is ambiguous without more context

转载 作者:搜寻专家 更新时间:2023-10-31 22:30:57 24 4
gpt4 key购买 nike

我正在将 Alamofire 更新到 4.0.0 Beta 1 并将 XCode 8 更新到 Beta 6。首先,我得到了 [String:String] is not convertible to [String : Any] 错误代码

let parameter = [
"scope":"\(scope)",
"client": "\(clientId)"
]
Alamofire.request(link, withMethod: .POST, parameters: parameter, encoding: .json).responseJSON

在我更改后将 [String:Any] 添加到参数中,错误消失但产生了新错误:Expression type 'Request' is ambiguous without more context

let parameter:[String:Any] = [
"scope":"\(scope)",
"client": "\(clientId)"
]

最佳答案

原来方法现在是小写的,所以使用 .post 而不是 .POST

https://github.com/Alamofire/Alamofire/issues/1423

关于ios - Alamofire 4.0.0 : [String:String] is not convertible to [String : Any] & Request is ambiguous without more context,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39098799/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com