Skip to content

Instantly share code, notes, and snippets.

@pxr
Created August 12, 2012 23:58
Show Gist options
  • Save pxr/3335561 to your computer and use it in GitHub Desktop.
Save pxr/3335561 to your computer and use it in GitHub Desktop.
Quick AFNetworking Test Code
NSURL *url = [NSURL URLWithString:@"http://api.domaintools.com/v1/domaintools.com/whois/"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSLog(@"response.registration: %@ response.whois: %@", [JSON valueForKeyPath:@"response.registration"], [JSON valueForKeyPath:@"response.whois"]);
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id something) { NSLog(@"ERROR: %@", error); } ];
[operation start];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment