Skip to content

Instantly share code, notes, and snippets.

@mitulmanish
Created October 10, 2016 07:38
Show Gist options
  • Save mitulmanish/b7495d15cc2442706d58ebabc5fb7daa to your computer and use it in GitHub Desktop.
Save mitulmanish/b7495d15cc2442706d58ebabc5fb7daa to your computer and use it in GitHub Desktop.
func imageInsights() {
let params = ["api_key": "d1a562a2f9cc209934068cbb573c29386ef112f3",
"url": "http://www.windowsmode.com/wp-content/uploads/2015/08/Puppy-Eye-Beagle.jpg",
"version": "2016-05-19"]
Alamofire.request(.GET, "https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classify", parameters: params).response { (request, response, data, error) in
do {
let serverData = try NSJSONSerialization.JSONObjectWithData(data!, options: .AllowFragments) as? [String: AnyObject]
if let data = serverData {
print(data)
}
} catch {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment