I am trying to perform an HTTP Request but I am getting the error: Optional(Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed. (Cocoa error 256.)" UserInfo=0x7d26e9b0 {NSURL=https://www.google.com/?gws_rd=ssl})
Here is my code:
let url = NSURL(string: "http://www.google.com/?gws_rd=ssl")
var error: NSError?
let html = NSString(contentsOfURL: url, encoding: NSUTF8StringEncoding, error: &error)
if (error != nil) {
println(error)
} else {
println(html)
}