Archived topic — some details may be out of date.
Mock servers built from saved collection examples are still supported. Postman now also has code-based mocks: JavaScript request handlers plus aconfig.yaml, stored as files in your Git repository, which you can run locally or deploy. Create one in the app, or use the Postman CLI to generate one from an OpenAPI spec, collection or dataset (postman mock generate) and run it (postman mock run). See About mocks and Create a mock.
Working with an AI coding agent? The Postman plugin can build and run mocks for you.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.
Starting today we are getting 502 errors from our mock server when it should return a 404. The url is “https://d78f59ff-ad8e-4c34-b62b-049a4361b136.mock.pstmn.io/connect/token/responsestatuscode/404”. I clicked the “Try” button and the response is “upstream connect error or disconnect/reset before headers. reset reason: protocol error”
Any ideas what the issue could be? The mock server works for the most part but randomly returns a 502.