Skip to content

Instantly share code, notes, and snippets.

@MaatheusGois
Last active May 27, 2019 05:22
Show Gist options
  • Select an option

  • Save MaatheusGois/4e348e280fc9d122a989cd12c50d61b1 to your computer and use it in GitHub Desktop.

Select an option

Save MaatheusGois/4e348e280fc9d122a989cd12c50d61b1 to your computer and use it in GitHub Desktop.
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