Example 2086
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": "Mrs. Natasha Becker I",
"email": "Demetris10@yahoo.com",
"role": "admin"
},
{
"id": 2,
"name": "Abelardo Wunsch DVM",
"email": "Natasha.Rutherford@hotmail.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "1238f750-de96-4b17-b1ab-41218cc88473"
}
delay_ms: 413 # simulated latency
}