Created
April 16, 2015 02:43
-
-
Save igordeoliveirasa/b7a8e0a76201a09fdbac to your computer and use it in GitHub Desktop.
iOS - Swift - Alamofire - Restful
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
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