Created
April 5, 2013 18:35
-
-
Save carlj/5321559 to your computer and use it in GitHub Desktop.
This file contains 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
NSURL *url = [NSURL URLWithString:@"http://cache-tester.herokuapp.com/contacts.json"]; | |
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url]; | |
[req setValue:@"\"3aa02883a2552b735e60c74ba4100548\"" forHTTPHeaderField:@"If-None-Match"]; | |
AFJSONRequestOperation *op = [AFJSONRequestOperation JSONRequestOperationWithRequest:req | |
success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { | |
NSLog(@"%s succes: %d",__FUNCTION__, response.statusCode ); | |
NSLog(@"%s succes %@", __FUNCTION__, [response.allHeaderFields objectForKey:@"ETag"]); | |
} failure:^(NSURLRequest *request, | |
NSHTTPURLResponse *response, | |
NSError *error, id JSON) { | |
NSLog(@"%s failed: %d %@",__FUNCTION__, response.statusCode, error ); | |
}]; | |
[op start]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment