Example 9994
API Mock
Mock API response payloads for testing.
# Mock API definition
{
endpoint: "/api/v1/users"
method: "GET"
status: 200
# JSON response body
response: """
[
{
"id": 1,
"name": "Reid Stanton",
"email": "Sigrid_Price@gmail.com",
"role": "admin"
},
{
"id": 2,
"name": "Mr. Chelsey Goyette",
"email": "Rosalinda_Kunde31@gmail.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "9fa43d3f-9548-4b14-ae4d-f61e84f16560"
}
delay_ms: 325 # simulated latency
}