Example 4400
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": "Laurianne Lueilwitz PhD",
"email": "Carlton19@yahoo.com",
"role": "admin"
},
{
"id": 2,
"name": "Georgette Gutmann",
"email": "Vanessa_Hickle@hotmail.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "1c54ce29-ca62-44d8-bf89-a350e81b3412"
}
delay_ms: 246 # simulated latency
}