How to use API Status Code Simulator
- Enter the status code, an optional delay and an optional JSON body.
- Press "Build URL" to get the endpoint, cURL command and snippets.
- Point your app configuration, mock or test at the URL.
- Press "Try it" to send a request from the page and confirm the status, headers and body.
API Status Code Simulator features
- Public endpoint returning any HTTP status 100–599 for your client and test code
- Optional delay (up to 30 s) to simulate slow or timing-out services
- Custom JSON body via the body parameter; sensible default body otherwise
- CORS enabled, any method accepted; 3xx codes include a Location header
- cURL and code snippets plus a "Try it" action that shows the live response
API Status Code Simulator example
Simulate rate limiting
Input:
Code 429 · Delay 1500 ms · Body { "error": "rate_limited", "retryAfter": 30 }Output:
https://www.mutqansoft.sa/api/v1/simulate/429?delay=1500&body=%7B%22error%22…
curl -i --max-time 7 'https://www.mutqansoft.sa/api/v1/simulate/429?…'
Live result: 429 Too Many Requests · 1.52 s · application/jsonFrequently asked questions about API Status Code Simulator
How do I use the endpoint?
Call https://www.mutqansoft.sa/api/v1/simulate/<code> with any HTTP method. Add ?delay=<ms> to slow the response down (up to 30 s) and ?body=<json> to control the body.
Does it support CORS?
Yes — the endpoint sends permissive CORS headers so browser apps and front-end tests can call it directly.
Are there rate limits?
Yes, per IP, to keep the service available for everyone. Use a local mock for high-volume load tests.
Can I get a redirect status?
Yes: 3xx codes return a Location header pointing back to the simulator so clients can exercise redirect handling.
Technical notes
The simulator is served by the platform Worker; it echoes the requested status, honours the delay within the platform limit and applies per-IP rate limiting. Status codes without a body (1xx, 204, 304) ignore the custom body.