Skip to content

Commit 5698ab3

Browse files
author
Nick Dawson
committed
Added support for repeated key value pairs through use of NSSet
1 parent ba60cab commit 5698ab3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

AFNetworking/AFHTTPClient.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ - (NSString *)URLEncodedStringValueWithEncoding:(NSStringEncoding)stringEncoding
160160
[array enumerateObjectsUsingBlock:^(id nestedValue, __unused NSUInteger idx, __unused BOOL *stop) {
161161
[mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue([NSString stringWithFormat:@"%@[]", key], nestedValue)];
162162
}];
163+
} else if ([value isKindOfClass:[NSSet class]]) {
164+
NSSet *set = value;
165+
[set enumerateObjectsUsingBlock:^(id obj, BOOL *stop) {
166+
[mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue(key, obj)];
167+
}];
163168
} else {
164169
[mutableQueryStringComponents addObject:[[AFQueryStringPair alloc] initWithField:key value:value]];
165170
}

0 commit comments

Comments
 (0)