Guides
HTTP testing utilities
Overview
POST /test/echoreturns 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/:coderesponds 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
/api/v1/test/echoReturns 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
| Name | In | Type | Description |
|---|---|---|---|
Content-Typerequired | header | string | Must 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.
{
"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
Delayed response
/api/v1/test/delayWaits ms milliseconds (0-5000) before responding. Great for testing loading states and client timeouts.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
msrequired | query | integer | Delay 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.
{
"delayedMs": 500,
"message": "Responded after 500ms"
}Try it
Respond with a status code
/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
| Name | In | Type | Description |
|---|---|---|---|
coderequired | path | integer | One 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.
{
"status": 200,
"message": "Simulated 200 OK response"
}