Example 1894
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": "Mrs. Deborah Berge",
"email": "Gail.Muller@hotmail.com",
"role": "admin"
},
{
"id": 2,
"name": "Irvin Hand",
"email": "Rick_Borer-Hickle@hotmail.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "ee0a824d-d466-4994-9a8e-0dbf3c4422cf"
}
delay_ms: 230 # simulated latency
}