test_mock
Fire a real HTTP request to the local mock engine to verify a mock endpoint returns the expected response. Use this AFTER creating or updating a mock to self-verify correctness. Test EACH rule scenario by sending different request bodies/headers that should match each rule. Check the 'X-Rule-Matched' response header to confirm which rule fired. If the wrong rule fires or no rule fires, use get_request_logs to debug the condition mismatch. You can also use bodies from get_saved_requests as test inputs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Optional request body string (JSON or form data) to send with the request | |
| path | Yes | Exact path to call, e.g. /v1/users/42 or /orders/abc123. Path variables must be filled with actual values. | |
| method | Yes | HTTP method to use for the test request (GET, POST, PUT, DELETE, PATCH, etc.) | |
| headers | No | Optional key-value map of request headers, e.g. {"Authorization": "Bearer token123", "Content-Type": "application/json"} | |
| projectSlug | Yes | The slug of the project (from list_projects). Used to build the engine URL: /mock/{slug}/{path} |