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¶m[]=b¶m[]=c
...or something like...
?params=[a][b][b].
精彩评论