Created
July 14, 2017 01:13
-
-
Save mblhaunted/fa9d6bc974d9c39d05fd5842537f30c7 to your computer and use it in GitHub Desktop.
swift is really terrible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get subject data sources | |
let urlAddress: String = "http://127.0.0.1:5000/subjects" | |
guard let url = URL(string: urlAddress) else { | |
print("cannot create url") | |
return | |
} | |
let urlRequest = URLRequest(url: url) | |
let config = URLSessionConfiguration.default | |
let session = URLSession(configuration: config) | |
// actually make the fucking request | |
let task = session.dataTask(with: urlRequest, completionHandler: { (data, response, error) in | |
print(response) | |
}) | |
task.resume() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment