Skip to content

Instantly share code, notes, and snippets.

@aclissold
Created May 31, 2015 19:21
Show Gist options
  • Save aclissold/d07ba04e84349af3b044 to your computer and use it in GitHub Desktop.
Save aclissold/d07ba04e84349af3b044 to your computer and use it in GitHub Desktop.
Swift GET request using spam and Alamofire
import Foundation
import Alamofire // Alamofire/Alamofire
import Blocker // aclissold/Blocker
Alamofire.request(.GET, "http://httpbin.org/get").responseJSON {
(_, _, JSON, _) in
if let JSON = JSON as? [String: AnyObject] {
println(JSON)
}
Blocker.unblock()
}
Blocker.block()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment