Example 5284
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": "Mr. Brandon Thiel",
"email": "Fernando_Pfannerstill@yahoo.com",
"role": "admin"
},
{
"id": 2,
"name": "Gloria Veum",
"email": "Carolanne.Ryan@gmail.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "f5f27134-2a9a-4d6d-9ae6-e79c46231bd9"
}
delay_ms: 110 # simulated latency
}