Example 14588
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": "Hazle Hand",
"email": "Amanda_Kertzmann53@hotmail.com",
"role": "admin"
},
{
"id": 2,
"name": "Rubye Olson",
"email": "Maurine_Rice@gmail.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "258ed299-e5f4-4360-b3d3-b6ed3d23684a"
}
delay_ms: 222 # simulated latency
}