Forum Discussion

andrearosalesIB's avatar
andrearosalesIB
New Contributor
6 years ago

REST Post multiple parameters with same name

Hi all,

 

I'm trying to send a REST POST request with a multipart/form-data content.

 

In particular, I need to send the same parameter (same name) with multiple values, but everytime I try to add the parameter I get the 'Property name exists!' alert.

 

I've tried to solve it by means of different methods already published here, such us:

 

1. Add a 'Multi-Value Delimiter': I tried to add a delimiter (e.g.: |) and include all the different values within one parameter: value1|value2|value3...

2. Disable Encoding to that parameter

3. Include a comma-separated list: $[value1,value2,value3...]

 

Even though the previous methods don't present any errors, when I send the request the endpoint doesn't seem to 'understand' that there are multiple values included in that parameter. And even though I send several values, the API only gets the first one.

 

Do you know if there is any other solution to include several parameters with the same name?

5 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Is it http header with multiple values are you trying to send? How are you setting? Screen shot please?
    • andrearosalesIB's avatar
      andrearosalesIB
      New Contributor

      Hi!

       

      Currently I have 2 headers: "Accept" and "Authorization". I attach the screenshot of the configuration. In particular, de parameter I'd have to send twice is "to".

       

      This parameter has the format: "{"to": "someemail@email.com","placeholders": {"firstName": "name"}}"

       

      So the idea would be to send the "to" parameter repeated as follows:

      to = {"to": "someemail@email.com","placeholders": {"firstName": "name"}}

      to = {"to": "someemail2@email.com","placeholders": {"firstName": "name2"}}

      to = {"to": "someemail3@email.com","placeholders": {"firstName": "name3"}}

      • italaber's avatar
        italaber
        New Contributor

        Hi, any update to this? Were you able to find a solution to the problem? I have a similar issue with adding multiple properties with the same name to a request.