Example 2796
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": "Jacqueline Medhurst",
"email": "Garret_Cartwright@gmail.com",
"role": "admin"
},
{
"id": 2,
"name": "Sedrick Runolfsdottir",
"email": "Shayna.Heaney18@yahoo.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "efc04243-e89b-4add-aab7-a47b3ccceae5"
}
delay_ms: 398 # simulated latency
}