cancel
Showing results for 
Search instead for 
Did you mean: 

REST Post multiple parameters with same name

Highlighted
New Contributor

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 5
Community Hero

Re: REST Post multiple parameters with same name

Is it http header with multiple values are you trying to send? How are you setting? Screen shot please?


Regards,
Rao.
New Contributor

Re: REST Post multiple parameters with same name

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"}}

New Contributor

Re: REST Post multiple parameters with same name

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.

Visitor

Re: REST Post multiple parameters with same name

Problem persists, SoapUI keeps saying "Property name exists!"

 

bump

New Contributor

Re: REST Post multiple parameters with same name

I did eventually track down one workaround if you want a parameter to display multiple values but did not manage to figure out a way to display a duplicate parameter with an empty string or null value.

 

To display duplicate parameters open the request where you want your duplicate parameters and in the "request properties" field (bottom left of the screen), set the "Multi-Value Delimiter" to something like "," or "/". Then in the request itself, select the parameter you would like to duplicate and in the "value" field, entere your values separated by the previously designated multi-value delimiter (e.g. 1,2). 

 

Now when you send the request, it show include both parameter values.

 

@vintprox