Skip to content
Mock APIs

Guides

HTTP testing utilities

Inspect exactly what your client sends, simulate slow networks, and trigger specific status codes so every loading and error state in your app gets exercised.

Overview

  • POST /test/echo returns the method, path, query, headers, and JSON body it received. Useful for debugging serializers and interceptors.
  • GET /test/delay?ms= waits up to 5000 ms before responding. Use it to test spinners, skeletons, and client timeouts.
  • GET /test/status/:code responds with one of: 200, 201, 202, 204, 400, 401, 403, 404, 405, 409, 410, 418, 422, 429, 500, 501, 502, 503, 504.

Secrets are never echoed

The echo endpoint replaces Authorization, Cookie, API-key headers, and body fields such as password or token with [redacted], and lists what it redacted. Still, never send real secrets to a public API.

Echo the request

POST/api/v1/test/echo

Returns the method, path, query parameters, safe request headers, and JSON body you sent. Any query parameters are accepted. The body is optional and must be a JSON object or array. Authorization headers, cookies, API keys, and sensitive body fields are redacted.

Headers

Headers for Echo the request
NameInTypeDescription
Content-TyperequiredheaderstringMust be application/json.

Request body

Any JSON object or array.

Status codes

  • 200The echoed request.
  • 400The request body is not valid JSON (INVALID_JSON).
  • 413Body larger than the size limit (PAYLOAD_TOO_LARGE).

Request

curl -X POST 'https://test.naimulhassan.me/api/v1/test/echo?source=docs' \
  -H 'Content-Type: application/json' \
  -H 'X-Custom-Header: demo' \
  -d '{
  "message": "Hello, Mock APIs!",
  "count": 3
}'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "method": "POST",
  "path": "/api/v1/test/echo",
  "query": {
    "source": "docs"
  },
  "headers": {
    "host": "localhost:4000",
    "user-agent": "curl/8.7.1",
    "accept": "*/*",
    "content-type": "application/json",
    "x-custom-header": "demo",
    "accept-encoding": "gzip, deflate",
    "content-length": "<length>",
    "connection": "close"
  },
  "body": {
    "message": "Hello, Mock APIs!",
    "count": 3
  },
  "contentType": "application/json",
  "redacted": []
}

Try it

POST
Headers
Open in playground
Send the request to see a live response.

Delayed response

GET/api/v1/test/delay

Waits ms milliseconds (0-5000) before responding. Great for testing loading states and client timeouts.

Parameters

Parameters for Delayed response
NameInTypeDescription
msrequiredqueryintegerDelay in milliseconds (0-5000).Range: 0-5000

Status codes

  • 200Sent after the delay.
  • 400Missing or out-of-range ms (INVALID_PARAMETER).
  • 429Too many requests from this IP (RATE_LIMIT_EXCEEDED).

Request

curl 'https://test.naimulhassan.me/api/v1/test/delay?ms=500'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "delayedMs": 500,
  "message": "Responded after 500ms"
}

Try it

GET
Headers

No header yet.

Open in playground
Send the request to see a live response.

Respond with a status code

GET/api/v1/test/status/{code}

Responds with the requested HTTP status code. Allowed codes: 200, 201, 202, 204, 400, 401, 403, 404, 405, 409, 410, 418, 422, 429, 500, 501, 502, 503, 504. Error codes use the standard error body with code SIMULATED_STATUS; 204 has an empty body.

Parameters

Parameters for Respond with a status code
NameInTypeDescription
coderequiredpathintegerOne of the allowed status codes.One of: 200, 201, 202, 204, 400, 401, 403, 404, 405, 409, 410, 418, 422, 429, 500, 501, 502, 503, 504

Status codes

  • 200Simulated success.
  • 400The code is not in the allowed list (INVALID_PARAMETER).
  • 404Simulated error (any allowed 4xx/5xx code).

Request

curl 'https://test.naimulhassan.me/api/v1/test/status/200'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "status": 200,
  "message": "Simulated 200 OK response"
}

Try it

GET
Headers

No header yet.

Open in playground
Send the request to see a live response.