Example 11100

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": "Edgar Barrows-Bruen",
"email": "Louise_Dibbert@gmail.com",
"role": "admin"
},
{
"id": 2,
"name": "Godfrey Von",
"email": "Leo8@hotmail.com",
"role": "user"
}
]
"""

# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "0f76acf6-df04-449c-bbd7-9d9d4803499e"
}
delay_ms: 147 # simulated latency
}

See also