I know this post is really old, but I have to reply because although BalusC's answer is marked as correct, it's not completely correct.

You have to write the query adding "[]" to foo like this:

foo[]=val1&foo[]=val2&foo[]=val3
Answer from user1922543 on Stack Overflow
Top answer
1 of 3
224

I know this post is really old, but I have to reply because although BalusC's answer is marked as correct, it's not completely correct.

You have to write the query adding "[]" to foo like this:

foo[]=val1&foo[]=val2&foo[]=val3
2 of 3
185

That depends on what the target server accepts. There is no definitive standard for this. See also a.o. Wikipedia: Query string:

While there is no definitive standard, most web frameworks allow multiple values to be associated with a single field (e.g. field1=value1&field1=value2&field2=value3).[4][5]

Generally, when the target server uses a strong typed programming language like Java (Servlet), then you can just send them as multiple parameters with the same name. The API usually offers a dedicated method to obtain multiple parameter values as an array.

foo=value1&foo=value2&foo=value3
String[] foo = request.getParameterValues("foo"); // [value1, value2, value3]

The request.getParameter("foo") will also work on it, but it'll return only the first value.

String foo = request.getParameter("foo"); // value1

And, when the target server uses a weak typed language like PHP or RoR, then you need to suffix the parameter name with braces [] in order to trigger the language to return an array of values instead of a single value.

foo[]=value1&foo[]=value2&foo[]=value3
_GET["foo"]; // [value1, value2, value3]
echo is_array($foo); // true

In case you still use foo=value1&foo=value2&foo=value3, then it'll return only the first value.

_GET["foo"]; // value1
echo is_array($foo); // false

Do note that when you send foo[]=value1&foo[]=value2&foo[]=value3 to a Java Servlet, then you can still obtain them, but you'd need to use the exact parameter name including the braces.

String[] foo = request.getParameterValues("foo[]"); // [value1, value2, value3]
Discussions

How to pass array as a parameter
However, what you can do is make this value in a json format, and then in a pre request script make that json into a native javascript array and do whatever you please with it. However, given the way you are trying to use your site ID in the request, you generally cannot pass an array as a ... More on community.postman.com
🌐 community.postman.com
4
0
June 25, 2020
Array Parameter in GET request
I need to send a GET request for weather data. One of the parameters is a list. If I send a single value in that parameter, all is well. As soon as I add another value, I get an error message. (The full link works 100% in postman. I presume Bubble works a bit different) Any advice? More on forum.bubble.io
🌐 forum.bubble.io
2
0
February 28, 2023
Post an array in a HTTP request
I have tried different configurations and I get a Status code 200 but with an error that says “emisor must be an array” (I believe an array). ... you need to add json object in Body/json module in http request box Best Regards Expert Help Pro_Tanvee ... Adding to what @Pro_Tanvee has mentioned in the earlier reply, what you want to do is pass ... More on community.make.com
🌐 community.make.com
2
0
June 8, 2023
Send array with GET Request - javascript
I am making a get request form Javascript to Python. And I am trying to pass a 2D array so something like [["one", "two"],["foo", "bar"]] And here is what I am currently trying but it is not worki... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Snipplr
snipplr.com › view › 4444 › passing-an-array-through-get-request
Passing an array through GET request - PHP Snipplr Social Repository
Passing my 2D array as an arguement and printing all days on which an entree wil be served based on the entree entered? ... In the first example, you can use $_GET["arr"] as an array.
🌐
Postman
community.postman.com › help hub
How to pass array as a parameter - Help Hub - Postman Community
June 25, 2020 - So yes, you would create the array of site_ids in your pre-request script. Or, if you already know these site ids ahead of time, you can place them in an environment variable in json format.
🌐
YouTrack Support
youtrack-support.jetbrains.com › hc › en-us › community › posts › 360010685319-Send-an-array-parameter-in-GET-HTTP-request-using-workflow
Send an array parameter in GET HTTP request using workflow – YouTrack Support | JetBrains
I believe passing parameters in an array of objects should help. For example: connection.getSync( "tasks.task.get", [ { name: 'select[]', value: 'description' }, { name: 'select[]', value: 'title' } ] ) P.S. if you'd like to get in touch with our support team directly for a quick answer to your question, please fill in a direct request at https://youtrack-support.jetbrains.com/hc/en-us/requests/new We'll be happy to help.
🌐
Elixir Forum
elixirforum.com › t › http-get-request-with-array-argument › 46182
HTTP GET request with array argument | Elixir Forum
February 21, 2022 - Example: Let’s say I want to request the list for IDs “12bb23d2-81fe-445b-bf5e-2716f582fbb0” and “654802aa-4515-4b52-b9a1-d74bf43f074b”. Would the URL be something like a) /api/sync/?ids=“12bb23d2…”,“654802aa…” b) /api/sync/?ids=“12bb23d2…”&ids=“654802aa…” c) /api/sync/?ids=“12bb23d2…”&ids=“654802aa…” d) … ... Try option c, it should be supported by default in Phoenix IIRC. You should be able to find the array in the request params like %{"ids" => ["12bb23d2...", "654802aa..."]}.
🌐
Laracasts
laracasts.com › discuss › channels › requests › passing-array-in-get-request
Passing Array in GET Request
I'm working on a module that displays invoices, and I'm setting up a filter with different options, within those is the status filter, where the users can select one or many of the different statuses ['unsent', 'sent', 'overdue', 'paid'] My question is, is it a good practice to send an array in the get request, or should I consider a different approach?
🌐
Bubble
forum.bubble.io › need help › apis
Array Parameter in GET request - APIs - Bubble Forum
February 28, 2023 - I need to send a GET request for weather data. One of the parameters is a list. If I send a single value in that parameter, all is well. As soon as I add another value, I get an error message. (The full link works 100% i…
Find elsewhere
🌐
Make Community
community.make.com › questions
Post an array in a HTTP request - Questions - Make Community
June 8, 2023 - I have tried different configurations and I get a Status code 200 but with an error that says “emisor must be an array” (I believe an array). ... you need to add json object in Body/json module in http request box Best Regards Expert Help Pro_Tanvee ... Adding to what @Pro_Tanvee has mentioned in the earlier reply, what you want to do is pass the JSON body inside the HTTP Module’s Request Content instead of Query Parameters.
🌐
Medium
medium.com › raml-api › arrays-in-query-params-33189628fa68
Arrays in query params. The same way there is no concensus over… | by Jonathan Stoikovitch | RAML by Example | Medium
November 4, 2020 - For better performance, you can ask the server to send only the fields you really need and get a partial response instead. To request a partial response, use the fields request parameter to specify the fields you want returned. You can use this parameter with any request that returns response data. (source: https://developers.google.com/drive/v3/web/performance#partial) ... In some situations, and in that “fields” use-case in particular, it may be useful to have fine-grained control over the fields passed to that “fields” query parameter.
🌐
Derekhassan
derekhassan.dev › blog › how-to-pass-an-array-as-a-query-string-to-express
How to Pass an Array as a Query String to Express
I tried this with the Node Express server I was working with, and it turns out Express will automatically parse this as an array for you! Let's take an example. Fall is approaching and what better example to use than apples? Let's say we have an /apples endpoint that allows us to filter on different apple varieties to find price and stock. Here is a simple Express route that handles this request: app.get('/apples', (req, res) => { const apples = [ { type: 'Empire', price: '$1.20', quantityAvailable: 10, }, { type: 'Granny Smith', price: '$0.85', quantityAvailable: 8, }, { type: 'Gala', price:
🌐
Google Groups
groups.google.com › g › producteev-api-discuss › c › 04yM_Vb3qzY
Passing arrays via HTTP GET?
> > > Sent from my iPhone > > > On Aug 4, 2010, at 6:04 AM, Tim Su <t...@todoroo.com> wrote: > > > > The tasks/set_label method has the following parameters: > > > > - integer id_task > > > - mixed id_label: can be anarrayof integer or just an integer > > > > How am I supposed to pass anarrayof integers via GET?
🌐
Brian Childress
brianchildress.co › sending-array-of-values-in-get-request
Sending an Array of Values in a GET Request - Brian Childress
February 15, 2022 - Sometimes you might need to send multiple values for a given parameter in a GET request to your API. For example, you have a GET /users API endpoint and you want to lookup information on several users at once.
🌐
Reddit
reddit.com › r/reactjs › sending array of objects in get request (axios)
r/reactjs on Reddit: Sending Array Of Objects in GET request (axios)
April 21, 2022 -

I'm implementing filter, sorting, pagination and search functionality via API call. For filter values i have to send array of objects in parameters.

Now I know when we want to send complex params in query we use POST method. But still wants to understand.

In my application, swagger stringify does it without any issue. I can't get the same format which is as below.

e g. This is i want in request headers (payload)

filter:[{name:"descriptive", value: "test"}]

I have tried qs package and JSON.stringify

qs.stringify(params)

or with arrayFormat but not getting the above format in payload.

Instead I'm getting this, which is not acceptable

filter[0][name]: descriptive

filter[0][value]: test

any help would be appreciated.

🌐
GitHub
gist.github.com › alexandru-calinoiu › 451bb7cdaa1e67111ae7
Send a CURL get request with an array param · GitHub
not working for me i ave to send a get request through curl with array parameter with a name[0]=value1&name[1]=value2 how should i do it can u help · Copy link · Copy Markdown · Make sure you have url encoded '[' with [ and ']' with ]. Your curl command should look something like this curl -X GET "httpx://uri?name[0]=value1&name[1]=value2" Copy link · Copy Markdown · @valo-ur can u pls look to my this issue: https://stackoverflow.com/questions/69640308/how-to-pass-array-in-php-curl-get-request-laravel i need an urgent fix.
Top answer
1 of 1
1
aaah - I see I didn't see the second Accno query parm The trouble with this is that SoapUI doesn't recognise it as different query parameter - and so doesn't allow you to add in duplicates. Someone else asked something similar a couple of weeks ago I believe - but there's no way around it as far as I can tell. The trouble is a GET query is like a SELECT query against a database. Currently your GET if you considered it as SQL would appear as follows: SELECT * FROM TABLEwhere accNo = '66000XW'and accNo = '660016A'and livePrice = 'true'and buyingPower = 'true'; and the above would be invalid - if accNo is unique - then you would never get a single record because you are trying to find a record where accNo is both '66000XW' and '660016A' I'm guessing from your request - you are trying to retrieve more than 1 record - i.e. 2 different account records where livePrice=true and buyingPower=true? so the SQL equivalent  would be as follows: SELECT * FROM TABLEwhere accNo in ('66000XW', '660016A')and livePrice = 'true'and buyingPower = 'true'; This requires either altering the URI (to allow parameterization in SoapUI)  or hardcoding your request. If you just want to inject this via SoapUI - you bodge it - so select to create a new resource from the URL and paste in the URL up to but not including the query parms e.g. https://domainname.com/ then once the resource has been created, you can then paste in the remainder of the URL (/portfolio-rs/v1/1/accounts/assetsDetail?acctNo=660016A&BacctNo=66000XW&livePrice=true&buyingPower=true) into the 'Resource' field. Then within the test case, click to create a new REST request, and select this option from your listing - this would allow you to submit the request from SoapUI but doesn't provide any of the advantages of using SoapUI above other REST client tools - SoapUI lends itself to parameterization and automation.  Essentially the approach I've just described hardcodes the values in - and so provides no advantages from using SoapUI compared with a different tool. That kindof highlights why REST URI design is so important and needs to be reviewed early in the design/development stages so that problems like this don't occur. I'm sorry I can't be of more help.