Example 6188
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": "Mr. Adam Green",
"email": "Arturo.Nitzsche31@gmail.com",
"role": "admin"
},
{
"id": 2,
"name": "Neal Ferry",
"email": "Jacquelyn81@hotmail.com",
"role": "user"
}
]
"""
# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "3e4724d4-1155-435c-ad23-f8c262656e5b"
}
delay_ms: 209 # simulated latency
}