Skip to content

Creating Mocks

Sran Manpreet edited this page Aug 23, 2023 · 1 revision

In Mockpit, you have the flexibility to define both static and dynamic mocks, tailoring your mock responses to your requirements.

Static mocks

Static mocks consistently respond with the same predefined body, making them ideal for scenarios where a fixed response is needed.

Dynamic mocks

Dynamic mocks offer the capability to adapt their response bodies dynamically. Achieve this by selecting Javascript as the response body type for the mock. The provided script will be evaluated upon each request to the endpoint, enabling personalized responses.

Tutorials

To create various types of mocks, refer to the following guides:

These guides offer step-by-step instructions for crafting static and dynamic mock configurations using Mockpit. This flexibility ensures accurate simulation of different API behaviors based on your project's needs.

Next: Create a simple static mock