Last active
March 16, 2016 16:37
-
-
Save darkcl/546c3f3e802b9c573055 to your computer and use it in GitHub Desktop.
AFNetworking example
This file contains hidden or 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
| AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:@"https://maps.googleapis.com"]]; | |
| manager.responseSerializer = [AFJSONResponseSerializer serializer]; | |
| NSDictionary *param = @{@"address": @"str"}; | |
| [manager GET:@"/maps/api/geocode/json" | |
| parameters:param | |
| success:^(NSURLSessionDataTask * _Nonnull task, id _Nonnull responseObject) { | |
| // Map your model objects with responseObject | |
| } | |
| failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { | |
| // Error handling | |
| }]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment