Skip to content

Instantly share code, notes, and snippets.

@matzew
Created March 14, 2013 14:34
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 matzew/ede419300262af93140a to your computer and use it in GitHub Desktop.
Save matzew/ede419300262af93140a to your computer and use it in GitHub Desktop.
NSURL* serverURL = [NSURL URLWithString:@"http://server/"];
AGPipeline* pipeline = [AGPipeline pipelineWithBaseURL:serverURL];
id<AGPipe> companies = [pipeline pipe:^(id<AGPipeConfig> config) {
[config setName:@"companies"];
}];
// READ comments for ID:1
[companies read:1 resource:@"teams/1/slackers" success:^(id responseObject) {
// LOG the JSON response, returned from the server:
NSLog(@"READ RESPONSE\n%@", [responseObject description]);
} failure:^(NSError *error) {
// when an error occurs... at least log it to the console..
NSLog(@"Read: An error occured! \n%@", error);
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment