Skip to content

Instantly share code, notes, and snippets.

@robertmryan
Created January 15, 2016 09:32
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 robertmryan/5d23a9eb1b5cd1c5a8b6 to your computer and use it in GitHub Desktop.
Save robertmryan/5d23a9eb1b5cd1c5a8b6 to your computer and use it in GitHub Desktop.
AFNetworking 3.x example
let manager = AFHTTPSessionManager()
manager.GET("http://example.com/resources.json", parameters: nil, progress: nil, success: { (task: NSURLSessionDataTask, responseObject: AnyObject?) -> Void in
print("JSON: \(responseObject!)")
}, failure: { (task: NSURLSessionDataTask?, error: NSError) -> Void in
print("Error: %@", error)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment