I am trying to us a RESTful API that returns some json data. I want to encapsulate the code that creates the HTTP Request and sets the headers in its own method so I can cal
The completion handler can't return anything because the closure you have to supply has to be of return type Void and not AnyObject!.
func dataTaskWithRequest(_ request: NSURLRequest!, completionHandler completionHandler: ((NSData!, NSURLResponse!, NSError!) -> Void)!) -> NSURLSessionDataTask!