Last active
May 27, 2019 05:22
-
-
Save MaatheusGois/4e348e280fc9d122a989cd12c50d61b1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| func getRequest(url: String, | |
| completion: @escaping ([String: Any]?, Error?) -> Void){ | |
| //URL válida | |
| guard let URL = URL(string: url) else { | |
| completion(nil, nil) | |
| return | |
| } | |
| //Cria a representacão da requisição | |
| let request = NSMutableURLRequest(url: URL) | |
| //Atribui à requisiçāo o método GET | |
| request.httpMethod = "GET" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment