【发布时间】:2018-07-24 11:59:34
【问题描述】:
Alamofire.request("https://test.com", method: .post, parameters: d, encoding: JSONEncoding.default)
.responseJSON { response in
print(response)
}
我正在使用上述方法使用 Alamofire 发送 post 请求。这里的“d”是 JSON 变量。但是一个错误是在调用中说额外的争论方法。为什么会这样。
【问题讨论】:
-
添加您作为参数发送的 json。
-
"d" 不能是 JSON 变量!!!必须是 [String: Any] 类型的变量。检查我的答案。
标签: ios json swift alamofire xcode8