Skip to navigation

Make calls to a simulation

View as Markdown

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.dev and a member has the slug new-mock-049rk, send the request to https://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-slug header. For example, send the request to https://my-simulation.mock.my-team.postman.dev/items with the header x-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:

curl http://localhost:4500/new-mock-049rk/items

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:

curl https://my-simulation.mock.my-team.postman.dev/new-mock-049rk/items

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 run command to run a simulation locally, then send requests to it. See Simulation commands for details.
  • Use the --simulation option with the postman collection run command 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.