【发布时间】:2017-09-24 17:04:51
【问题描述】:
我有 Consumer Key、Consumer Secret、Token Key 和 Token Secret 来获取 Data API。像邮递员这样:
我必须像上面的捕获邮递员一样获取我的 API 的数据。然后我有这样的 Alamofire 方法请求:
Alamofire.request("https://conversation.8villages.com/1.0/contents/articles?state=published", headers: headers).responseJSON { response in
print("test", response.request!) // original URL request
print("ini responseny", response.response!) // HTTP URL response
print("test", response.data!) // server data
print("test", response.result) // result of response serialization
if let JSON = response.result.value {
print("JSON: \(JSON)")
}
}
所以,我不知道如何在 get 方法中添加或传递我的令牌。请有人帮助我。
我正在使用 OAuthSwift 和 Alamofire。
【问题讨论】: