Created
December 6, 2012 21:12
-
-
Save jlee42/4228465 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
[[RKObjectManager sharedManager].HTTPClient postPath:@"/api/v2/json/api_users/sign_in" parameters:params success:^(AFHTTPRequestOperation *operation, id JSON) | |
{ | |
// Success | |
NSLog(@"Success"); | |
NSString *auth_token = [JSON class]; | |
NSLog(@"AUTH_TOKEN: %@", auth_token); | |
} failure:^(AFHTTPRequestOperation *operation, NSError *error) | |
{ | |
// Error | |
if ([operation.response statusCode] == 401) { | |
UIAlertView *alert = [[UIAlertView alloc] | |
initWithTitle:@"Failure" | |
message:@"Failed" | |
delegate:nil | |
cancelButtonTitle:@"OK" | |
otherButtonTitles:nil]; | |
[alert show]; | |
} | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment