Skip to content

Instantly share code, notes, and snippets.

@igordeoliveirasa
Created April 16, 2015 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igordeoliveirasa/b7a8e0a76201a09fdbac to your computer and use it in GitHub Desktop.
Save igordeoliveirasa/b7a8e0a76201a09fdbac to your computer and use it in GitHub Desktop.
iOS - Swift - Alamofire - Restful
let params: Dictionary<String,AnyObject> = ["user[country_name]": countryName, "user[country_code]": countryCode, "user[mobile_number]": mobileNumber, "user[name]":"", "user[device_token]":deviceToken]
Alamofire.request(.POST, ConstantsBackend.URL_REGISTER, parameters: params)
.validate(statusCode: 200..<300)
.validate(contentType: ["application/json"])
.responseJSON { (_, _, JSON, ERROR) in
if (ERROR != nil)
{
println("FALHA AO REGISTRAR")
LoadingOverlay.shared.hideOverlayView()
}
else {
println(JSON)
println("SUCESSO AO REGISTRAR")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment