Mock a specific error response

Return an exact 4xx/5xx status and body to reproduce an edge case on demand.

When to use this

Reproducing a specific failure — a 422 with a particular validation payload, a 500, a 429 — is hard against a real API. Pin a mock to the exact status and body you need and point your code at it to verify it handles that case correctly.

Create the mock

curl -X POST https://quickmock.dev/api/mocks \
  -H 'Content-Type: application/json' \
  -d '{
  "method": "GET",
  "response_status": 422,
  "content_type": "application/json",
  "response_body": "{\"error\":{\"code\":\"validation_failed\",\"fields\":[\"email\"]}}"
}'

Call it

curl https://quickmock.dev/m/<slug>

What you get

HTTP 422 -> {"error":{"code":"validation_failed","fields":["email"]}}

Build your own

Create a mock

← All guides