I would like to create a mock server that replies semi-dynamically to a POST request. There would be two variations of the 200-OK, replying either with ‘false’ or ‘true’ and a set of JSON-data.
I was hoping the mock server could randomly switch between these examples. The reply for either scenario may be hardcoded, as long as it switches between the examples.
I would settle for using variables on Collection level uses the RandomInt(0,1) script and depending on the outcome, include either the content of variable ‘reply-0’ or ‘reply-1’. If we’d go this way, I was hoping someone could give me a head start with some code
I could use a variable in my application that could switch between two mock requests, to simulate different responses. However, this doesn’t feel the way mock servers should be used and will result in a lot more changes once the actual API is built.