Example 6195
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": "Ms. Roberta Grady",
"email": "Ethel_Abernathy@gmail.com",
"role": "admin"
},
{
"id": 2,
"name": "Tonya Fay",
"email": "Luz_Jast30@hotmail.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "59e9cf04-ce11-44f7-850e-363f3c35b094"
}
delay_ms: 154 # simulated latency
}