开发者

Format for passing a numerically indexed array in a get request

I know that the standard method for passing named parameters in a get request, is:

?paramName=value&anotherParam=anot开发者_StackOverflowherValue...

In my case, I want to pass an array of parameters However, I want to pass multiple parameters with the same meaning - an array. In js that would be

 var users = ['bob', 'sam', 'bill']; 

and I want to pass the users array via get.

What would be the way to accomplish this?


You will need to serialize them into some form of string that can be re-parsed into an array.

For, example, you could use...

?param[]=a&param[]=b&param[]=c

...or something like...

?params=[a][b][b].
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜