Example 8500

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": "Joyce Doyle IV",
"email": "Ethyl.Mueller58@yahoo.com",
"role": "admin"
},
{
"id": 2,
"name": "Dr. Rex Deckow",
"email": "Geovanni_Dooley@hotmail.com",
"role": "user"
}
]
"""

# Response headers
headers: {
Content-Type: "application/json"
X-Total-Count: "2"
X-Request-Id: "55dcdd34-ac2f-4390-a904-460190696d76"
}
delay_ms: 54 # simulated latency
}

See also