Testing guide
Exercise more than the happy path.
Create temporary records, update state, delete data, slow responses, and trigger known failures without setting up a backend.
Mutations
Test create, update, and delete flows
Send JSON to POST, PUT, and PATCH endpoints. A successful create returns 201, updates return 200, and a successful delete returns 204 with no response body.
curl -X POST 'https://api.apimocker.com/todos' \
-H 'Content-Type: application/json' \
-d '{"title":"Test the success state","completed":false,"userId":1}'POSTCreate
Add a temporary record. Server-generated IDs and timestamps are returned.
PUTReplace
Send every required field for the resource.
PATCHUpdate
Send only the fields that should change.
DELETERemove
Delete a record until the next daily reset.
Validation
Handle invalid input
Missing fields, invalid emails, out-of-range strings, and invalid IDs return a 400 response. Validation responses include field-level details when available.
{
"error": "Validation Error",
"message": "Invalid input data",
"details": [
{
"type": "field",
"value": "",
"msg": "Title is required and must be between 1 and 200 characters",
"path": "title",
"location": "body"
}
]
}Error simulation
Trigger predictable failures
GET /error/404Not found404GET /error/500Server failure500GET /error/validationValidation failure400GET /error/timeoutRequest that never completesTimeoutLimits and reset
Design around the shared service
Maximum requests per IP address in a rolling 15-minute window. The next response is 429.
Maximum POST, PUT, PATCH, and DELETE requests per IP address each day. The next response is 429.
The shared database returns to its original users, posts, todos, and comments.
Browser requests are accepted from any origin, and total-count headers are exposed.
JSON request bodies larger than 10 MB are rejected.