Example 3585
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": "Tricia Lind",
"email": "Carrie_Cremin61@hotmail.com",
"role": "admin"
},
{
"id": 2,
"name": "Pinkie Wunsch",
"email": "Dimitri_Gottlieb@yahoo.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "ac674a87-7150-4fed-ba76-25931bb1e251"
}
delay_ms: 67 # simulated latency
}