Example 8583
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": "Todd Hamill",
"email": "Bo_Franey@yahoo.com",
"role": "admin"
},
{
"id": 2,
"name": "Ms. Barton Cremin-Dicki",
"email": "Aileen_Streich33@yahoo.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "b81fe5e6-e9d3-45fe-b085-90d7cd49cae2"
}
delay_ms: 394 # simulated latency
}