I\'m trying to learn about working with APIs in Swift. As a good first test, I figured I\'d hit the itunes API and just return some search results. I\'m in playground using the
Not sure why you aren't seeing an error—I get this:
NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9807)
You can test more effectively with httpbin.org—this works perfectly for me:
let url = NSURL(string: "http://httpbin.org/get")
let task = NSURLSession.sharedSession().dataTaskWithURL(url!) {(data, response, error) in
println(NSString(data: data, encoding: NSUTF8StringEncoding))
}
task.resume()