-
Notifications
You must be signed in to change notification settings - Fork 1
Creating Mocks
In Mockpit, you have the flexibility to define both static and dynamic mocks, tailoring your mock responses to your requirements.
Static mocks consistently respond with the same predefined body, making them ideal for scenarios where a fixed response is needed.
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.
To create various types of mocks, refer to the following guides:
- Create a simple static mock
- Create a dynamic mock with javascript
- Create a dynamic mock using query parameters and path variables with javascript
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.