Example 15481
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": "Dr. Loy McLaughlin",
"email": "Krista65@hotmail.com",
"role": "admin"
},
{
"id": 2,
"name": "Lenora Gorczany",
"email": "Gerard83@hotmail.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "be2406e1-fe19-4e0f-bf4b-e56660302544"
}
delay_ms: 184 # simulated latency
}