5

I have setup a mock server in Postman.

For a request X, I have added 2 examples (responses)

  1. 200 Success Response
  2. 400 Bad request

When I use x-mock-response-code I am able to get the appropriate response.

But when I dont use the x-mock-response-code, I am always getting 400 Bad Request. I am expecting 200 by default. But its not happening.

Do I need to add some thing to example response ? I tried to change example name as Default but no use..

renjuwm
  • 81
  • 6

1 Answers1

1

If your example requests are identical, Postman will deterministically return the response for one of them. There is no concept of 'default' examples at this time. If you want a particular response to be returned, make sure your example requests are not identical and only one example request matches the request you are sending. Or use the x-mock-response-code header as you are already doing.

Pranaya Tomar
  • 199
  • 1
  • 13