I'm trying to make an HTTP request, but I'm getting an error: optional (error domain = NSCOARR dot com = 256) Operation could not be completed. (Coco Error 256.) "UserInfo = 0x7d26e9b0 {NSURL =})
Here is my code:
url = NSURL (string:" http: // www. Google.com/?gws_rd=ssl ") var error: NSError? Html = NSString (contentOfURL: url, encoding: NSUTF8StringEncoding, error: and error) If (error! = Zero) {println (error)} and {println (html }}
This line is created as follows:html = NSString (contentOfURL: url !, encoding: NSASCIIStringEncoding, error: and error)
Comments
Post a Comment