Author: Chris Lattner
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
import Alamofire | |
func makeGetCallWithAlamofire() { | |
let todoEndpoint: String = "https://jsonplaceholder.typicode.com/todos/1" | |
Alamofire.request(todoEndpoint) | |
.responseJSON { response in | |
// check for errors | |
guard response.result.error == nil else { | |
// got an error in getting the data, need to handle it | |
print("error calling GET on /todos/1") |