Example 9998

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": "Kattie Altenwerth",
"email": "Lois.Heathcote73@yahoo.com",
"role": "admin"
},
{
"id": 2,
"name": "Kianna Barrows",
"email": "Earl_Schowalter@gmail.com",
"role": "user"
}
]
"""

# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "f146630e-2c9d-4326-bf1b-7dcef2c5f486"
}
delay_ms: 310 # simulated latency
}

See also