2016-08-12 4 views

ответ

1

я понял, решение:

let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() 
configuration.HTTPAdditionalHeaders = [ 
    "X-MYAPI-Key" : "sdSDfgsdfjdsf3rsdfSDqy3y"] 
let session = NSURLSession(configuration: configuration) 

let urlString = "https://api.myapiservice.com" 
guard let url = NSURL(string: urlString) else { return } 
let task = session.dataTaskWithURL(url) { 
    (data, response, error) in 
} 
task.resume()