Send POST array
<p>i wish to send some data as array from my iphone app to server</p>

<p>When i was posting single variables before i was sending the post as an NSString </p>

<pre><code>NSString *post =[[NSString alloc] initWithFormat:@"userName=%@&amp;accountID=%@&amp;",
                                                  username,accId];

NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding  allowLossyConversion:YES];

NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];

NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; 
[request setURL:url]; 
[request setHTTPMethod:@"POST"]; 
[request setValue:postLength forHTTPHeaderField:@"Content-Length"]; 
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; 
[request setHTTPBody:postData];
</code></pre>

<p>Now i wish to send an array of these usernames and accountIds, how do i send an NSArray in a POST and then in php on my server how can i retrieve it?</p>

<p>Thanks</p>
