Example 7397
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": "Miss Ida Emmerich",
"email": "Alfonso.Berge23@gmail.com",
"role": "admin"
},
{
"id": 2,
"name": "Floyd Kemmer",
"email": "Joanne40@hotmail.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "aabd42b6-60d0-4d19-81c4-c55fae97f56b"
}
delay_ms: 395 # simulated latency
}