I am trying to send a GET request using RESTKit that looks like this:
getNames?names=bob&names=joe&names=joey
When I try to set the parameters dictionary with the same key names, it don't work. Only the first key and value get sent.
I know there's a question about this from a long time ago here. But there is still no answer, and I was wondering if there's any development on this.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I figured out a solution. This is the code I use:
[[RKObjectManager sharedManager] getObjectsAtPath:queryPath
parameters:nil
success:nil failure:nil];
and the queryPath looks like this: getNames?names=bob&names=joe&names=joey
and it actually works.
make sure to use stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding so that the &
and ?
will go through properly .