I am trying to pass multiple values for one parameter key to an HTTP request using the AFHTTPClient method "postPath". However, the parameters variable is an NSDictionary so I can not set multiple values for my key "email". I've tried sending the e-mail values as a comma separated string but that does not work as my server returns an error saying I have not specified any e-mail value.
I did read in the documentation about using multipartFormRequestWithMethod method but I could not completely figure out how to make this work. Can anyone provide an example of using this method with multiple values for a single key?
Thanks
Rich
Combining the multi query values for one key.
If you use NSDictionary + NSSet you get query url without [] from NSArray.
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
[NSSet setWithObjects:@"value1", @"value2", nil], @"myKey", nil];
AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
NSURLRequest *request = [httpClient requestWithMethod:@"GET" path:@"/path" parameters:params];
PS: Better late than never...
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