1
是否可以將Alamofire與Yelp Search API一起使用?如果是這樣,你如何生成OAuth簽名?這是我正在努力工作的代碼片段。提前致謝。將Alamofire與Yelp Search API結合使用
func searchForBusinessesByLocation(term: String, location: String) {
Alamofire.request(Method.GET, NSURL(string: "http://\(self.api_host)\(self.search_path)")!, parameters: ["term":self.searchTerm, "location":self.searchLocation,"limit":self.search_limit, "oauth_consumer_key":self.CONSUMER_KEY, "oauth_token":self.TOKEN, "oauth_signature_method":self.SIGNATURE_METHOD, "oauth_signature":self.SIGNATURE, "oauth_timestamp":self.timestamp(), "oauth_nonce":self.NONCE]).responseString(encoding: NSUTF8StringEncoding, completionHandler: {(_,_,result, error) in
if(result != nil) {
println("result \(result)")
}
else {
println("no result")
}
if(error != nil) {
println("error \(error)")
}
else {
println("no error")
}
})
}