Q:

how to POST data to an endpoint in iOS7?

I know there are tons ways to POST from an iOS app from nsurlconnection to asihttprequest.
What is the preferred or best practices way to post a few variables, asynchronously, to an end point, in iOS7?
My endpoint can be invoked in the following fashion:
curl -d 'username=tt&email=tt@example.com' 127.0.0.1/register

A:

I ended up using afnetworking.  This method works real nice.
-(void) postDictionary:(NSDictionary *)data toEndpoint:(NSString *)endpoint{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];

    [manager POST:endpoint parameters:data success:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSLog(@"JSON: %@", responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"Error: %@", error);
    }];

}

