Example 4895
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": "Jerald Leuschke",
"email": "Bernhard.Marquardt@yahoo.com",
"role": "admin"
},
{
"id": 2,
"name": "Joan Ziemann",
"email": "Harriet.Kuhic@hotmail.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "f97ea5f1-33a0-4f49-a237-c180b18bc993"
}
delay_ms: 143 # simulated latency
}