【发布时间】:2019-02-25 14:17:18
【问题描述】:
我有这个:
curl https://address --user appID:appKey -d grant_type=password -d scope=read -d format=json -d username="username" -d password="password"
我尝试快速转换它。你能帮帮我吗?
用户名和密码与appId和appKey
之间没有联系
我已经有了:
private func LoadKey() {
var params : [String:String] = ["grant_type":"password",
"scope":"read",
"format":"json",
"username":"myUsername",
"password":"myPassword"]
Alamofire.request(url, method: .post, encoding: JSONEncoding.default).responseJSON { (response) in
print(response.result.value)
}
}
我不知道如何给出 appId 和 appKey
提前感谢您的回答,祝您有美好的一天。
【问题讨论】:
-
到目前为止你尝试了什么?
-
我更新我的帖子
-
您可以使用我在此处给出的提示:stackoverflow.com/questions/53637437/alamofire-with-d/… 来了解在 Alamofire 请求构造中放置什么参数。然后你会看到(你没有给它)它缺少 --user 参数,所以 Alamofire + --user 给出:stackoverflow.com/questions/31434008/…
标签: ios swift web-services connection alamofire