Example 15885
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": "Cheryl Durgan",
"email": "Doreen.Krajcik75@yahoo.com",
"role": "admin"
},
{
"id": 2,
"name": "Iris Mann",
"email": "Sarina.Dare@yahoo.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "c6f8a4a5-002a-40b2-a07d-7e5ccf762e1c"
}
delay_ms: 429 # simulated latency
}