开发者

Format for passing a numerically indexed array in a get request

开发者 https://www.devze.com 2023-03-16 00:57 出处:网络
I know that the standard method for passing named parameters in a get request, is: ?paramName=value&anotherParam=anot开发者_StackOverflowherValue...

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

精彩评论

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