Example 7588
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": "Tyson Hackett",
"email": "Isai.Runolfsdottir23@gmail.com",
"role": "admin"
},
{
"id": 2,
"name": "Ray Rau",
"email": "Clifford97@yahoo.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "2e99b988-5ff8-4640-9d99-8b867652a1f4"
}
delay_ms: 149 # simulated latency
}