0

I am trying to test my APIs in postman's mock server. I have an endpoint which returns a json with a few key value pairs.

In my request I have some key value pairs in the json format. What I want to test is as follows

Lets say if the request has a parameter called "parameter1" with value "p1". Now I want to return a different json response because it has the value of "p1". Lets say I make another request with the "parameter1" now having a value "p2" I want to return a different response. How do I do this?

I want to execute if statements / filters like if parameter1 == "p1" then return x1, if else parameter1 == "p2" then return something else etc

I looked at postman documentation but cannot figure out. Thanks in advance.

  • I only understand one item "API call can different response by parameter1 value(p1 or p2)" but I don't understand, Postman's mock server. It is possible mock server by Postman? Postman is client of API not server, can you explain or draw diagram with your API and Postman communication? – Bench Vue Dec 16 '22 at 19:57

0 Answers0