What you can do with Temporary Mock API
- Create a mock api endpoint
- Simulate a rest api response
- Test with a fake endpoint
What this network diagnostic measures
Provision temporary, isolated mock REST endpoints with custom JSON responses, HTTP status codes, and latency simulation for frontend and API testing.
Example input
Endpoint: /users/1, Method: GET, Status: 200, Body: {"id": 1, "name": "Jane Doe", "role": "admin"}Example output
{"id":1,"name":"Example User"}Practical workflow
- Load a request template or choose a supported HTTP method, path, and optional exact query string.
- For POST, PUT, PATCH, or QUERY requests, optionally enter the exact JSON request body to match.
- Set a JSON response body (up to 4 KB), an HTTP status, an expiry of 1, 6, or 24 hours, and an optional delay of 250 ms, 1 second, or 3 seconds.
- Create the temporary endpoint, then copy its URL or cURL example and make a request before its expiry.
Common use cases
- Unblocking frontend user interface development before backend API services are built.
- Simulating server errors, rate limits, and network lag to test client-side resilience.
- Checking frontend loading and error states with controlled JSON responses and response delays.
Important notes and limitations
- Creating a mock sends its configuration to the EasyUtils API, which returns an encrypted bearer URL. Anyone with the URL can use it until expiry; EasyUtils does not provide request history, but hosting and network providers may process request metadata. Do not include secrets or sensitive personal information.
- HTML responses and custom response headers are unsupported; dynamic response fields can randomize supported scalar JSON values or increment numbers.
Mock HTTP server & cURL terminal testing
Serve mock JSON file with Python http.server
python3 -m http.server 8080 --directory ./mock-dataQuickly spins up a local HTTP file server responding with mock JSON payloads for frontend development.
Simulate API latency and headers with cURL
curl -i -X POST -H 'Content-Type: application/json' -d '{"status":"ok"}' https://httpbin.org/delay/1Sends a mock POST payload to a test harness that delays response by 1 second to test UI loading skeletons.
Inspect HTTP response headers and status codes
curl -sI https://easyutils.dev/api/mock/sampleDumps response headers including Content-Type, Cache-Control, and rate-limiting headers without downloading the body.
Mock endpoint latency & CORS troubleshooting
Access to fetch at '...' from origin '...' has been blocked by CORS policy
Cause: Mock API response omitted 'Access-Control-Allow-Origin: *' or rejected browser preflight OPTIONS request.
Solution: Ensure mock endpoint responds with 204 No Content to OPTIONS requests and includes necessary Access-Control headers.
HTTP 429 Too Many Requests on mock endpoint
Cause: Exceeded mock endpoint creation or runtime rate limits (10 creates/min, 20 requests/min).
Solution: Back off request frequency or leverage local mock JSON files served via Vite / Next.js API mock handlers.
Continue your workflow
- API Request Tester — send test HTTP requests to your newly created mock endpoints.
Frequently asked questions
How long do temporary mock endpoints remain active?
Choose an expiry of 1 hour, 6 hours, or 24 hours before creating the endpoint.
Can I simulate network latency or server timeouts?
Yes. Choose no delay, 250 ms, 1 second, or 3 seconds to test loading and error-state behavior.
Does the mock API accept POST and PUT request bodies?
You can optionally require an exact JSON request body for POST, PUT, PATCH, or QUERY. EasyUtils does not provide request history, but hosting and network providers may process request metadata.