Example 13993
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": "Tyshawn Kihn",
"email": "Ricky48@gmail.com",
"role": "admin"
},
{
"id": 2,
"name": "Dolores Hamill",
"email": "Edwin.Keebler@hotmail.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "14e253c9-0b72-4cab-b9e4-682207517cfd"
}
delay_ms: 122 # simulated latency
}