The purpose of API mocking is to simulate real-world scenarios during API development. You might mock an API as part of an API-first development process, or to support API testing and other stages of the API lifecycle. While you’re usually trying to mock an ideal API behavior, sometimes you want to mock real-world behavior that isn’t ideal—in order to understand potential problems and come up with solutions. To help strengthen Postman mock capabilities for this second purpose, the release of Postman v7.32.0 introduced mock server delays. Let’s take a quick look at how you can now configure your mock delay settings in Postman.
To more accurately depict API behavior with mock servers in Postman, select a standard delay of 100 milliseconds or 300 milliseconds:
If you need to set a delay other than these two default settings, you can create a custom delay between 0 and 180,000 milliseconds, pushing your mock servers to address a wider variety of real-world constraints:
The new delay configurations enable you to more precisely define your mocked API behavior so that you can develop truly robust testing and other client workflows. Build resilient systems by mocking positive and negative behavior expected from the APIs powering web and mobile applications to cover the full range of scenarios.
Postman mock servers have been evolving rapidly over the last couple of releases. In addition to the new delays settings, we’ve introduced mock call logs, and the generation of collections from OpenAPI, Swagger, RAML, or GraphQL APIs. And we’re not stopping there. We’re investing more development cycles to continue advancing API mocking capabilities in Postman. So let us know how to meet your mock server needs and what new features you’d like to see in future releases.