Answer the question
In order to leave comments, you need to log in
How to generate dynamic response Postman Mock server?
Hello!
To conduct tests, I need to make a mock server. The server must accept the external request, generate an ID (UUID) for it, and return a response that includes this ID. The id must be new in every response from my mock server.
To implement the task, I chose Postman, where I successfully created a mock-server, from which I can receive a response. But in this answer, it is required to hardcode all the fields in advance, which does not completely solve my problem.
My question is, is there any way to generate Postman mock-server response fields after receiving a request? Is there something like a "Pre-request script" tab that would allow me to collect the response depending on the request.
PS: The question concerns not only UUID, but also access to request fields from a mock-server in general - is there any way to build an if block on the request fields and generate a response depending on what came in?
I hope I explained everything clearly) All the best and Happy New Year!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question