Skip to content

Instantly share code, notes, and snippets.

@TramPamPam
Created January 14, 2020 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TramPamPam/4a570e79edaad1f7794e7c6139c0c399 to your computer and use it in GitHub Desktop.
Save TramPamPam/4a570e79edaad1f7794e7c6139c0c399 to your computer and use it in GitHub Desktop.
import Cocoa
let session = URLSession(configuration: URLSessionConfiguration.default)
var getTask = URLSessionTask()
var request = URLRequest(url: URL(string: "https://itunes.apple.com/search?term=jack+johnson&limit=25")!)
request.httpMethod = "GET"
getTask = session.dataTask(with: request, completionHandler: { (data, response, error) in
debugPrint("(data \(data != nil), response \(response), error \(response)")
})
getTask.resume()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment