I'm using ASIFormDataRequest to post data to a server, and I need to post an array of values (strings in the example below). I'm using an enumerator to loop through each and add them to the request, but only the last one comes through - the behaviour you'd expect for setPostValue, not addPostValue.
Any idea why only one value is coming through?
NSEnumerator *pupilEnumerator = [pupils objectEnumerator];
id pupil;
while ((pupil = [pupilEnumerator nextObject])) {
[request addPostValue:pupil forKey:@"pupils"];
}
Note this also occurs for addFile and addPostData.
Cheers.
Your loop just keeps replacing the "pupils" value. Get rid of the loop and try [request addPostValue:pupils forKey:@"pupils"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With