Created
February 8, 2017 04:57
-
-
Save salverde/bbbdbae5a99017bc434c6d2c7f0120ad to your computer and use it in GitHub Desktop.
UnboxedAlamofire snippet
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 url = apiBaseURL + "/abusers.json" | |
Alamofire.request(url, method: .get, parameters: params, encoding: URLEncoding.default).validate(statusCode: 200..<300).responseObject { (response: DataResponse<Abuser>) in | |
switch response.result { | |
case .success(let searchResult): | |
completion?(searchResult) | |
case .failure(let error): | |
print("error: \(error)") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment