Forum Discussion

sbeauvais's avatar
sbeauvais
Contributor
11 years ago

[Res]duplicate properties in REST request

Hello,

How to I configure a REST method/request to have duplicate properties, e.g.,

GET /dev/api/calendar/locations?locationIds=96&locationIds=33&startDate=01-Feb-2014&endDate=28-Feb-2014


As you can see, property "locationIds" is included twice.

If the REST method/request cannot be configured to support this, can I build the GET command programmatically? I have tried to 'cheat' by setting the value of locationIds to "96&locationIds=33" but the ampersand and the equals symbols are replaced by their code (even though I tried to entitize them).

So, is this possible to do, and if so, how?


Sincerely,
Séverin B.

14 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    There is a "Multi-Value Delimiter" property for the REST request in the bottom left table of properties, set this to the regular expression that should be used to separate the values, for example "\|" for pipe. Once you do that you will locationids=1&locationids=2&locationids=3. This should work.

    Thanks,
    Jeshtha
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    I should have mentioned it earlier, but now you have the summary!

    Thanks,
    Jeshtha
    • socaltester's avatar
      socaltester
      Contributor

      I attempted to follow the above solution provided in portions by Jeshtha and summarized by sbeauvais and got stuck after being able create the second duplicate parameter I needed. Basically, I created the non-entitized parameter that is to be entitized and created duplicate parameter 2 as entitized with "disable encoding" enabled, but creating a third duplicate parameter or more is failing due to SoapUI's insistance of unique paramater names.

       

      Can someone help? Am I missing something in sbeauvais's summary of steps? For instance, do I need to create a data generator after the entitized and non-entitized options are exhausted?

       

      FYI. I know this is a 5 year old post, but I thought it best to reply with my question here instead creating a new post. If a new post needs to be create, please let me know and I shall.

      • Olga_T's avatar
        Olga_T
        SmartBear Alumni (Retired)

        Hi socaltester,

         

        I would suggest that you create a new topic anyway with the detailed information on the behavior to start a brand new investigation.