简体   繁体   中英

How I can get all values of the same query parameter in the postman

I have the GET request in Postman:

/dominance?start={{start}}&end={{end}}&slugs[]=bitcoin-btc&slugs[]=ethereum-eth

For writing tests for API call, I need to write in an array all possible values, where the key is "slugs[]" How I can do it?

Depending on how the API is implemented, what the values are and how many they are, you could either have something like

/dominance?start={{start}}&end={{end}}&slugs[]=ALL

Making all the code edits in the backend, or

/dominance?start={{start}}&end={{end}}&slugs[]=bitcoin-btc&slugs[]=ethereum-eth&slugs[]=cardano-ada&slugs[]=tether-tet

and so on, but doing so will create a very long URI.

If you have the possibility of editing the backend, I'd do a special case using something like that ALL keyword, or consider creating custom groups.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM