Added support for repeated key value pairs through use of NSSet
This commit is contained in:
parent
ba60cab1be
commit
5698ab3768
1 changed files with 5 additions and 0 deletions
|
|
@ -160,6 +160,11 @@ NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value) {
|
|||
[array enumerateObjectsUsingBlock:^(id nestedValue, __unused NSUInteger idx, __unused BOOL *stop) {
|
||||
[mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue([NSString stringWithFormat:@"%@[]", key], nestedValue)];
|
||||
}];
|
||||
} else if ([value isKindOfClass:[NSSet class]]) {
|
||||
NSSet *set = value;
|
||||
[set enumerateObjectsUsingBlock:^(id obj, BOOL *stop) {
|
||||
[mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue(key, obj)];
|
||||
}];
|
||||
} else {
|
||||
[mutableQueryStringComponents addObject:[[AFQueryStringPair alloc] initWithField:key value:value]];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue