Simple GET request

suggest change
// define url
let url = NSURL(string: "")

//create a task to get data from a url
let task = NSURLSession.sharedSession().dataTaskWithURL(url!)

   /*inside this block, we have access to NSData *data, NSURLResponse *response, and NSError *error returned by the dataTaskWithURL() function*/
  (data, response, error) in

  if error == nil 
      // Data from the request can be manipulated here
      // An error occurred 

//make the request

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents