Make calls to a simulation
Running simulations locally is available on all Postman plans. Deploying a simulation to the Postman Cloud is available on Solo, Team, and Enterprise plans only. For more information, see the pricing page.
After you run a simulation, send requests to its mocks and observe how they respond with the scenario behaviors applied. A simulation serves all of its member mocks behind one address, so each request identifies the member you want to reach.
Reach a member mock
How you address a member depends on the Route by option you chose when you set up the simulation:
- URL path — Include the member’s slug as the first segment of the request path. For example, if the simulation URL is
https://my-simulation.mock.my-team.postman.devand a member has the slugnew-mock-049rk, send the request tohttps://my-simulation.mock.my-team.postman.dev/new-mock-049rk/items. - Header — Use the same simulation URL for every member, and select one with the
x-mock-slugheader. For example, send the request tohttps://my-simulation.mock.my-team.postman.dev/itemswith the headerx-mock-slug: new-mock-049rk.
Send local requests
In Local View, run the simulation on the Postman desktop app, then send requests to its local address and observe the responses to confirm each mock behaves as expected with its behaviors applied.
For example, send a request to a member at the simulation’s local URL:
Sending local requests to a simulation requires the Postman desktop app.
Send requests to a deployed simulation
After you deploy a simulation as a mock server, it has an always-available URL that anyone with access can call. Reach each member by path or header, the same as a local run.
For example, send a request to a member at the deployed URL:
Because a deployed simulation is a mock server, authentication and inspection work the same way as any mock server deployed from a mock. To learn more, see Call a mock server deployed from a mock.
Make calls with the Postman CLI
- Use the
postman simulation runcommand to run a simulation locally, then send requests to it. See Simulation commands for details. - Use the
--simulationoption with thepostman collection runcommand to run a collection against a simulation. See Collection commands for details. - To run your service against a simulation without changing its code, use proxy mode. The Postman CLI serves the mocks behind a local forward proxy, so your service reaches each mock by its real hostname while calls to un-mocked services pass through to the real thing. See Proxy mode for details.
To view a simulation’s logs and run history, see View simulation logs and history.