Example 14097
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": "Jerald Hermann",
"email": "Kenny.Corkery@hotmail.com",
"role": "admin"
},
{
"id": 2,
"name": "Noah O'Reilly",
"email": "Waylon_Metz82@gmail.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "2d64b722-5431-4a4f-9af1-d376a5f3d443"
}
delay_ms: 370 # simulated latency
}