-
Notifications
You must be signed in to change notification settings - Fork 83
Description
I've seen that when you use a GET request, the parameter cannot be a dictionary of dictionaries. Why is that? The code is this one:
-
(NSString_)parameterStringForDictionary:(NSDictionary_)parameters {
NSMutableArray *stringParameters = [NSMutableArray arrayWithCapacity:parameters.count];[parameters enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if([obj isKindOfClass:[NSString class]]) {
[stringParameters addObject:[NSString stringWithFormat:@"%@=%@", key, [obj encodedURLParameterString]]];
}
else if([obj isKindOfClass:[NSNumber class]]) {
[stringParameters addObject:[NSString stringWithFormat:@"%@=%@", key, obj]];
}
else
[NSException raise:NSInvalidArgumentException format:@"%@ requests only accept NSString, NSNumber and NSData parameters.", self.operationRequest.HTTPMethod];
}];return [stringParameters componentsJoinedByString:@"&"];
}