Forum Discussion

bhavesh_patil's avatar
bhavesh_patil
New Contributor
3 years ago
Solved

ReadyPI Query Parameter - I want to add same parameter twice

I have an endpoint where I need to send 2 values for a single parameter.

Eg.

Signature?product=auto&product=home

 

In postman, i can pass 2 params as "product"  with Auto and Home values. But not in ReadyAPI.

Need help.

If i give this in single product param  "product=auto&home" its not working.

  • Hey bhavesh_patil,

    Ok, so you have multiple repeating query parms with the label 'product', right?

    Follow these instructions:

    1. Via the API config section , highlight the relevant API, select the 'Request' form to.edit the product query parameter (in the listing) - and in the 'Advanced Options' expandable section of the API config, enable "Disables URL Encoding of the parameter value" checkbox at bottom of the 'Advanced Options' section

    2.  Via the Request Properties (bottom left of your screen), find the 'Multi-Value Delimiter'  and input \| in the 'Value' field

    3. Via the parameter listing - within the 'Request' form (that lists all the parameters) find the 'product' parm - and within the 'Value' field input the different parameter values separated with a | character, so using the information from your post in the product query parm value field input auto|home

    Make sure your MediaType setting is the correct value and you should be good to go!

    NOTE: if you want to parameterise your query parm values instead of hardcoding them, you can do the same as always, you just need to remember to include the | separator -->> ${Project #value1}|${Project#value2}

    Cheers!

    Rich

2 Replies

  • richie's avatar
    richie
    Community Hero
    Hey bhavesh_patil,

    Ok, so you have multiple repeating query parms with the label 'product', right?

    Follow these instructions:

    1. Via the API config section , highlight the relevant API, select the 'Request' form to.edit the product query parameter (in the listing) - and in the 'Advanced Options' expandable section of the API config, enable "Disables URL Encoding of the parameter value" checkbox at bottom of the 'Advanced Options' section

    2.  Via the Request Properties (bottom left of your screen), find the 'Multi-Value Delimiter'  and input \| in the 'Value' field

    3. Via the parameter listing - within the 'Request' form (that lists all the parameters) find the 'product' parm - and within the 'Value' field input the different parameter values separated with a | character, so using the information from your post in the product query parm value field input auto|home

    Make sure your MediaType setting is the correct value and you should be good to go!

    NOTE: if you want to parameterise your query parm values instead of hardcoding them, you can do the same as always, you just need to remember to include the | separator -->> ${Project #value1}|${Project#value2}

    Cheers!

    Rich