NSDictionary *customerDictionary = [NSDictionary dictionaryWithObjectsAndKeys:@" blah@blah.com ", @"email", @"1", @"facebook", nil]; NSArray *customerArray = [NSArray arrayWithObjects:customerDictionary, nil]; NSDictionary *parameters = [NSDictionary dictionaryWithObjectsAndKeys:customerArray, @"customers", nil]; NSURLRequest *request = [sharedHTTPClient requestWithMethod:@"POST" path:@"/api/upload" parameters:parameters]; AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {}]; [operation start];
On the Node.JS server, printing the body displays:
{ customers: [ '1', ' blah@blah.com ' ] }
The expected print should be:
{ customers: [{ facebook:'1', email:' blah@blah.com ' }] }
What am I doing wrong?
source share