Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Note this snippet requires AFNetworking v2.x
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.securityPolicy.allowInvalidCertificates = YES;
manager.requestSerializer = [AFJSONRequestSerializer serializer];
NSMutableDictionary *result = [[NSMutableDictionary alloc] init];
result[@"username"] = @"JohnSmith";
result[@"email"] = @"";
result[@"phone"] = @"06543213131";
result[@"name"] = @"John Smith";
POST: @""
parameters: result
success:^(AFHTTPRequestOperation *operation, id responseObject){
// currently responseobject logs as "(null)". No idea why
failure:^(AFHTTPRequestOperation *operation, NSError *error){
NSLog(@"Error: %@", error);} // failure callback block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.