postmanconfigurablequery-string

Configurable methods in Postman request


This request is working fine

https://localhost:3000/api/catalog/1435

Being catalog the method and 1435 the catalogId to get.

I cannot transform the server (ASP controller) to work with

https://localhost:3000/api/catalog/?1435

that is, 1435 become a Query param.

How can I make the last method configurable in a Postman request?


Solution

  • The original seems perfectly fine to be honest:

    https://localhost:3000/api/catalog/1435
    

    Now, if you want to query the catalog, and thus use a query string, you would likely want to do it as:

    https://localhost:3000/api/catalog?id=1435
    

    This is what a client could do to GET a catalog that matches id 1435. In my mind, this makes more sense if you can query a catalog by multiple parameters. Because from a data model point of view if the catalog resource key is the id, then I would use what you had originally.