Skip to content

Instantly share code, notes, and snippets.

@amadeu01
Created February 11, 2018 19:48
Show Gist options
  • Save amadeu01/6e5a1f56ed7abfdd0a50cde0801bec23 to your computer and use it in GitHub Desktop.
Save amadeu01/6e5a1f56ed7abfdd0a50cde0801bec23 to your computer and use it in GitHub Desktop.
import UIKit
import Foundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
let url = URL(string: "http://www.google.com/")!
let task = URLSession.shared.dataTask(with: url) { data, response, error in
if let error = error {
print(error)
return
}
print(response)
}
task.resume()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment