Does the HTTP Request Support Repeated Query Parameters?

This topic was automatically generated from Slack. You can find the original thread here.

In HTTP requests, is there any support for the same query parameter being repeated? I tested this and it seems to ignore all but one of the values. The api I’m calling is Retrieve Email Statistics for Categories | SendGrid Docs | Twilio and I’m trying to pass two values such as https://api.sendgrid.com/v3/categories/stats?categories=email1&categories=email2…. I assume this can only be accomplished with a code step.

Try this: ?categories[]=email1&categories[]=email2

Sorry, I didn’t specify that I was trying in the UI

the resulting call ignores all but the last categories parameter

Yeah, try adding the brackets afterwards.

do you mean like this?

i also tried adding brackets after on separate lines but that fails on the other end saying missing the parameter entirely

for now, i can do it in code or in separate calls, just wondering if it’s possible without doing that

Looks like this might be a bug in how Pipedream handles the parameters.

Interestingly enough, Zapier won’t let you do this either. They automatically dedup the parameters if you add the same one more than once - adding numbers after

: Yeah, this is pretty easy to reproduce with a workflow that calls itself (warning: don’t deploy this as it will create an infinite loop! :sweat_smile:)

image.png

Looks like there’s no standard way of doing this though! :open_mouth:

I always assumed using square brackets was a standard. :man-facepalming:

Ya, I have definitely seen it done a few different ways

can’t remember which api it was but some one that URI encoded the comma between values such as ?cars=Saab%2CAudi

or maybe it was a pipe :rolling_on_the_floor_laughing:

I wonder if it’s an axios thing

import fetch from "node-fetch";

export default defineComponent({
  async run({ steps, $ }) {
    return await fetch("https://eochz1eod3cid1k.m.pipedream.net?test=value1&test=value2");
  },
});

Our HTTP action uses axios, but above I’m using node-fetch

Ah! Might be.

FYI: You don’t need to import node-fetch anymore.

It’s native now (experimental since version 18, and stable since version 21).

Oh yea good call