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.

Revisions

  1. pxr created this gist Aug 12, 2012.
    8 changes: 8 additions & 0 deletions gistfile1.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    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];