Tag: nsurlrequest

嵌套的NSDictionary&NSArray与AFNetworking不能正常工作

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]; 在Node.JS后端,打印出正文显示: { customers: […]