Created
February 2, 2013 04:58
-
-
Save jakemoore/4696159 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
- (void)validateInviteCode:(NSString *)inviteCode | |
success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, id JSON))success | |
failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON))failure | |
{ | |
// Build parameters | |
NSMutableDictionary *params = [NSMutableDictionary dictionary]; | |
[params setObject:inviteCode forKey:@"invite_code"]; | |
// Send request | |
NSMutableURLRequest *req = [self requestWithMethod:@"POST" path:@"registration/family" parameters:params]; | |
self.parameterEncoding = AFJSONParameterEncoding; // MUST BE SET TO ENSURE CORRECT ENCODING | |
[[AFJSONRequestOperation JSONRequestOperationWithRequest:req | |
success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { | |
success(request, response, JSON); | |
} failure:^(NSURLRequest *request , NSHTTPURLResponse *response , NSError *error, id JSON) { | |
failure(request, response, error, JSON); | |
}] start]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment