Skip to content

Instantly share code, notes, and snippets.

@jlee42
Created December 6, 2012 19:20
Show Gist options
  • Save jlee42/4227441 to your computer and use it in GitHub Desktop.
Save jlee42/4227441 to your computer and use it in GitHub Desktop.
NSString *deviceUUID = [[NSUserDefaults standardUserDefaults] valueForKey:UUID_USER_DEFAULTS_KEY];
NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys:
usernameField.text, @"user[pawsid]",
passwordField.text, @"user[password]",
deviceUUID, @"user[device_uuid]", nil];
NSString *urlString = [NSString stringWithFormat:@"%@://%@:%@/api/v2/json/api_users/sign_in",
[NSObject TT_PROTOCOL], [NSObject TT_HOST], [NSObject TT_PORT]];
[[RKObjectManager sharedManager].HTTPClient postPath:urlString parameters:params success:^(AFHTTPRequestOperation *operation, id JSON)
{
// Success
NSLog(@"Success");
} failure:^(AFHTTPRequestOperation *operation, NSError *error)
{
// Error
NSLog(@"Error");
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment