我正在将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)"
]
答案 0 :(得分:0)
将.JSON
替换为.JSONEncoding.default