shealtiel
shealtiel

Reputation: 8388

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=anotherValue...

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?

Upvotes: 2

Views: 159

Answers (1)

alex
alex

Reputation: 490481

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].

Upvotes: 1

Related Questions