Mock servers are very helpful when the production API is not ready or we don’t want run our requests against real data yet.
Let’s see how we can setup a mock server in Postman.
- First we need to create a collection
- Let’s name it and select to add a request
- Let’s now add the request url
- Now lets add an example
- Add the response
- Now let’s create the mock server
- Select existing collection
- Name the server and configure it
- Now lets use the new environment and change the request to have the {{url}}
- Now let’s Send the request: