MockerAPI - HTTP Mocking & Testing Service ============================================ ## Overview MockerAPI is a free HTTP mocking and testing service for developers. It provides three powerful tools: 1. **Status Code Tester**: Test any HTTP status code with optional delays and custom headers 2. **Mock API Generator**: Create custom mock API endpoints with authentication and custom responses 3. **HTTP Tester (httpbin Alternative)**: Inspect and test HTTP requests with 10 httpbin-like endpoints ## API Endpoint Base URL: https://free.mockerapi.com ============================================ TOOL 1: STATUS CODE TESTER ============================================ ## Basic Usage GET https://free.mockerapi.com/{status-code} Example: GET https://free.mockerapi.com/200 ## Supported Status Codes - 1xx Informational: 100-103 - 2xx Success: 200, 201, 202, 203, 204, 205, 206, 207, 208, 226 - 3xx Redirection: 300, 301, 302, 303, 304, 305, 307, 308 - 4xx Client Errors: 400-418, 421-426, 428, 429, 431, 451 - 5xx Server Errors: 500-511 ## Advanced Features ### 1. Response Delay Two ways to add delay: - Query parameter: ?delay=3000 - Header: x-delay: 3000 Value: 1-60000 (milliseconds) Priority: Header takes precedence over query parameter Examples: GET https://free.mockerapi.com/404?delay=3000 curl -H "x-delay: 3000" https://free.mockerapi.com/500 ### 2. Custom Response Headers Header: x-response Format: Header1:Value1,Header2:Value2 Example: x-response: X-API-Key:abc123,X-Rate-Limit:100 ### 3. Custom Payload Header: x-payload Format: Valid JSON string Example: x-payload: {"user":{"id":123,"name":"John"},"active":true} ## HTTP Methods Supported All methods: GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD ## Response Format ### Default Response (JSON) { "success": true, "status": 200, "statusText": "OK - Request succeeded", "timestamp": "2025-10-10T10:30:45.123Z", "request": { "method": "GET", "url": "/200", "fullUrl": "https://free.mockerapi.com/200" } } ### With Delay { ... "delay": { "requested": 3000, "unit": "milliseconds" } } ### With Custom Headers { ... "customHeaders": { "X-API-Key": "abc123", "X-Rate-Limit": "100" } } ============================================ TOOL 2: MOCK API GENERATOR ============================================ ## Overview Create custom mock API endpoints with your own JSON responses, HTTP methods, status codes, and authentication. ## Create Mock Endpoint **Endpoint:** POST https://free.mockerapi.com/api/endpoints ### Request Body Schema { "type": "open|bearer|api-key|basic-auth", // Required "method": "GET|POST|PUT|DELETE|PATCH", // Required "statusCode": 200, // Required (200-599) "responseBody": { /* your JSON */ }, // Required (max 10KB) "headers": { /* custom headers */ }, // Optional "delay": 0, // Optional (0-60000ms) // For bearer or api-key authentication: "token": "sk_test_abc123", // Optional (auto-generated if not provided) // For basic-auth only: "username": "admin", // Required for basic-auth "password": "secret123" // Required for basic-auth } ### Authentication Types 1. **open**: No authentication required 2. **bearer**: Requires Authorization: Bearer {token} header 3. **api-key**: Requires X-API-Key: {token} header 4. **basic-auth**: Requires Authorization: Basic {base64(username:password)} header ### Response { "success": true, "endpoint": { "id": "a4ee8fc9-7f54-470d-b64f-4795214dc872", "url": "https://free.mockerapi.com/mock/a4ee8fc9-7f54-470d-b64f-4795214dc872", "type": "bearer", "method": "GET", "statusCode": 200, "responseBody": { /* your JSON */ }, "headers": {}, "delay": 0, "token": "sk_test_1234567890abcdef", // Only if auth type is bearer/api-key "username": "admin", // Only if auth type is basic-auth "password": "secret123", // Only if auth type is basic-auth "createdAt": "2025-10-10T14:41:07.895Z", "hitCount": 0 } } ## Call Mock Endpoint **Endpoint:** {METHOD} https://free.mockerapi.com/mock/{uuid} The HTTP method must match the method you specified when creating the endpoint. ### Authentication Examples **Open Endpoint (No Auth):** curl https://free.mockerapi.com/mock/a4ee8fc9-7f54-470d-b64f-4795214dc872 **Bearer Token:** curl -H "Authorization: Bearer sk_test_1234567890abcdef" \ https://free.mockerapi.com/mock/a4ee8fc9-7f54-470d-b64f-4795214dc872 **API Key:** curl -H "X-API-Key: sk_test_1234567890abcdef" \ https://free.mockerapi.com/mock/a4ee8fc9-7f54-470d-b64f-4795214dc872 **Basic Auth:** curl -u admin:secret123 \ https://free.mockerapi.com/mock/a4ee8fc9-7f54-470d-b64f-4795214dc872 ### Response Returns your custom responseBody with your specified statusCode, headers, and delay. ### Error Responses **401 Unauthorized** - Missing or invalid authentication { "error": true, "status": 401, "message": "Unauthorized - Authentication required" } **404 Not Found** - Endpoint doesn't exist { "error": true, "status": 404, "message": "Mock endpoint not found" } **405 Method Not Allowed** - Wrong HTTP method { "error": true, "status": 405, "message": "Method not allowed. This endpoint expects GET" } ============================================ TOOL 3: HTTP TESTER (httpbin Alternative) ============================================ ## Overview A powerful httpbin alternative providing 10 endpoints for testing and inspecting HTTP requests. Perfect for debugging, API development, and testing client applications. **Interactive UI:** https://mockerapi.com/http-tester.html ## Available Endpoints ### 1. GET /get Inspect GET requests with query parameters. **Usage:** GET https://free.mockerapi.com/get?key1=value1&key2=value2 **Response:** { "args": { "key1": "value1", "key2": "value2" }, "headers": { "User-Agent": "...", "Accept": "..." }, "origin": "1.2.3.4", "url": "https://free.mockerapi.com/get?key1=value1&key2=value2" } ### 2. POST /post Inspect POST requests with body data. **Usage:** POST https://free.mockerapi.com/post Content-Type: application/json Body: {"name": "John", "age": 30} **Response:** { "args": {}, "data": "{\"name\":\"John\",\"age\":30}", "json": { "name": "John", "age": 30 }, "headers": { "Content-Type": "application/json" }, "origin": "1.2.3.4", "url": "https://free.mockerapi.com/post" } ### 3. PUT /put Inspect PUT requests with body data. **Usage:** PUT https://free.mockerapi.com/put Content-Type: application/json Body: {"id": 123, "name": "Updated"} **Response:** { "args": {}, "data": "{\"id\":123,\"name\":\"Updated\"}", "json": { "id": 123, "name": "Updated" }, "headers": {}, "origin": "1.2.3.4", "url": "https://free.mockerapi.com/put" } ### 4. PATCH /patch Inspect PATCH requests with body data. **Usage:** PATCH https://free.mockerapi.com/patch Content-Type: application/json Body: {"status": "active"} **Response:** { "args": {}, "data": "{\"status\":\"active\"}", "json": { "status": "active" }, "headers": {}, "origin": "1.2.3.4", "url": "https://free.mockerapi.com/patch" } ### 5. DELETE /delete Inspect DELETE requests with query parameters. **Usage:** DELETE https://free.mockerapi.com/delete?id=123 **Response:** { "args": { "id": "123" }, "headers": {}, "origin": "1.2.3.4", "url": "https://free.mockerapi.com/delete?id=123" } ### 6. GET /headers Returns all request headers. **Usage:** GET https://free.mockerapi.com/headers **Response:** { "headers": { "User-Agent": "Mozilla/5.0...", "Accept": "*/*", "Host": "free.mockerapi.com", "X-Custom-Header": "value" } } ### 7. GET /basic-auth/{username}/{password} Test HTTP Basic Authentication. **Usage:** GET https://free.mockerapi.com/basic-auth/admin/secret Authorization: Basic YWRtaW46c2VjcmV0 **Success Response (200):** { "authenticated": true, "user": "admin" } **Failure Response (401):** { "authenticated": false, "message": "Unauthorized" } ### 8. GET /bearer Test Bearer Token Authentication. **Usage:** GET https://free.mockerapi.com/bearer Authorization: Bearer your-token-here **Success Response (200):** { "authenticated": true, "token": "your-token-here" } **Failure Response (401):** { "authenticated": false, "message": "Missing or invalid Bearer token" } ### 9. GET /status/{code} Returns any HTTP status code (100-599). **Usage:** GET https://free.mockerapi.com/status/404 GET https://free.mockerapi.com/status/201 **Response:** Returns the specified status code with an appropriate status message. For 2xx: {"status": 200, "message": "OK"} For 4xx/5xx: {"status": 404, "message": "Not Found"} ### 10. GET /delay/{seconds} Returns a delayed response (1-10 seconds). **Usage:** GET https://free.mockerapi.com/delay/3 GET https://free.mockerapi.com/delay/5 **Response (after delay):** { "delay": 3, "url": "https://free.mockerapi.com/delay/3", "timestamp": "2025-10-10T10:30:45.123Z" } ## Key Features - ✅ All HTTP methods supported (GET, POST, PUT, PATCH, DELETE) - ✅ Request inspection (headers, query params, body) - ✅ Authentication testing (Basic Auth, Bearer Token) - ✅ Status code testing (100-599) - ✅ Delay testing (1-10 seconds) - ✅ JSON response format - ✅ CORS enabled - ✅ No rate limiting - ✅ Free forever ============================================ CODE EXAMPLES ============================================ ## Status Code Tester Examples ### cURL # Basic request curl https://free.mockerapi.com/200 # With delay (query param) curl https://free.mockerapi.com/404?delay=3000 # With delay (header) curl -H "x-delay: 3000" https://free.mockerapi.com/500 # With custom headers curl -H "x-response: X-API-Key:abc123,X-Rate-Limit:100" \ https://free.mockerapi.com/200 # With custom payload curl -H 'x-payload: {"user":{"id":123},"active":true}' \ https://free.mockerapi.com/200 ### JavaScript (Fetch) fetch('https://free.mockerapi.com/404?delay=1000') .then(response => response.json()) .then(data => console.log(data)) // With headers fetch('https://free.mockerapi.com/200', { headers: { 'x-delay': '3000', 'x-response': 'X-API-Key:abc123' } }) .then(response => response.json()) .then(data => console.log(data)) ### Python (requests) import requests # Basic request response = requests.get('https://free.mockerapi.com/200') print(response.json()) # With headers response = requests.get( 'https://free.mockerapi.com/404', headers={ 'x-delay': '3000', 'x-response': 'X-API-Key:abc123' } ) print(response.json()) ## Mock API Generator Examples ### cURL - Create Open Endpoint curl -X POST https://free.mockerapi.com/api/endpoints \ -H "Content-Type: application/json" \ -d '{ "type": "open", "method": "GET", "statusCode": 200, "responseBody": { "message": "Hello World", "status": "success" }, "headers": {}, "delay": 0 }' ### cURL - Create Bearer Token Endpoint curl -X POST https://free.mockerapi.com/api/endpoints \ -H "Content-Type: application/json" \ -d '{ "type": "bearer", "method": "POST", "statusCode": 201, "responseBody": { "id": 123, "created": true } }' ### JavaScript - Create and Call Mock Endpoint // Create endpoint const response = await fetch('https://free.mockerapi.com/api/endpoints', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ type: 'bearer', method: 'GET', statusCode: 200, responseBody: { users: [{ id: 1, name: 'John' }] } }) }); const { endpoint } = await response.json(); console.log('Endpoint URL:', endpoint.url); console.log('Bearer Token:', endpoint.token); // Call endpoint const mockResponse = await fetch(endpoint.url, { headers: { 'Authorization': `Bearer ${endpoint.token}` } }); const data = await mockResponse.json(); console.log(data); // { users: [{ id: 1, name: 'John' }] } ### Python - Create and Call Mock Endpoint import requests # Create endpoint response = requests.post( 'https://free.mockerapi.com/api/endpoints', json={ 'type': 'api-key', 'method': 'GET', 'statusCode': 200, 'responseBody': {'data': [1, 2, 3]} } ) endpoint = response.json()['endpoint'] print(f"Endpoint URL: {endpoint['url']}") print(f"API Key: {endpoint['token']}") # Call endpoint mock_response = requests.get( endpoint['url'], headers={'X-API-Key': endpoint['token']} ) print(mock_response.json()) # {'data': [1, 2, 3]} ### Go - Create and Call Mock Endpoint package main import ( "bytes" "encoding/json" "net/http" ) func main() { // Create endpoint payload := map[string]interface{}{ "type": "bearer", "method": "GET", "statusCode": 200, "responseBody": map[string]string{"status": "ok"}, } body, _ := json.Marshal(payload) resp, _ := http.Post( "https://free.mockerapi.com/api/endpoints", "application/json", bytes.NewBuffer(body), ) var result map[string]interface{} json.NewDecoder(resp.Body).Decode(&result) endpoint := result["endpoint"].(map[string]interface{}) // Call endpoint req, _ := http.NewRequest("GET", endpoint["url"].(string), nil) req.Header.Set("Authorization", "Bearer "+endpoint["token"].(string)) client := &http.Client{} mockResp, _ := client.Do(req) } ## HTTP Tester Examples ### cURL - Test GET Request curl https://free.mockerapi.com/get?name=John&age=30 ### cURL - Test POST Request curl -X POST https://free.mockerapi.com/post \ -H "Content-Type: application/json" \ -d '{"name":"John","age":30}' ### cURL - Test Headers curl https://free.mockerapi.com/headers \ -H "X-Custom-Header: value123" ### cURL - Test Basic Auth curl -u admin:secret123 \ https://free.mockerapi.com/basic-auth/admin/secret123 ### cURL - Test Bearer Token curl -H "Authorization: Bearer my-token-here" \ https://free.mockerapi.com/bearer ### cURL - Test Status Code curl https://free.mockerapi.com/status/404 ### cURL - Test Delay curl https://free.mockerapi.com/delay/3 ### JavaScript - Test POST Request const response = await fetch('https://free.mockerapi.com/post', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'John', age: 30 }) }); const data = await response.json(); console.log(data.json); // { name: 'John', age: 30 } console.log(data.headers); // Request headers ### Python - Test Bearer Auth import requests headers = {'Authorization': 'Bearer my-token-123'} response = requests.get('https://free.mockerapi.com/bearer', headers=headers) print(response.json()) # {'authenticated': True, 'token': 'my-token-123'} ============================================ USE CASES ============================================ ## Status Code Tester 1. **API Testing**: Test how your application handles different HTTP status codes 2. **Error Handling**: Verify error handling logic without breaking production APIs 3. **Integration Testing**: Mock third-party API responses during testing 4. **Load Testing**: Simulate slow responses with custom delays 5. **Frontend Development**: Develop UI components that handle various response states 6. **CI/CD Pipelines**: Use in automated testing workflows 7. **Timeout Testing**: Simulate slow endpoints with delay parameter 8. **Documentation**: Create interactive API documentation with live examples ## Mock API Generator 1. **Frontend Prototyping**: Build frontend before backend is ready 2. **API Contract Testing**: Test against agreed API contracts 3. **Authentication Flow Testing**: Test bearer, API key, and basic auth flows 4. **Third-Party API Mocking**: Mock external APIs for testing 5. **Demo Applications**: Create demos without complex backend setup 6. **API Documentation**: Provide working examples in documentation 7. **Learning & Training**: Teach API concepts with real endpoints 8. **CI/CD Testing**: Use in automated test suites ## HTTP Tester (httpbin Alternative) 1. **Request Debugging**: Inspect exactly what your client is sending 2. **Header Testing**: Verify headers are properly set in requests 3. **Authentication Testing**: Test Basic Auth and Bearer token implementations 4. **Client Development**: Debug HTTP clients without needing a real backend 5. **Webhook Testing**: Test webhook payloads and formats 6. **API Learning**: Understand how different HTTP methods work 7. **Integration Testing**: Replace httpbin.org in test suites 8. **Network Debugging**: Diagnose request/response issues ============================================ FEATURES ============================================ ## Status Code Tester ✅ All HTTP status codes (100-599) ✅ Custom response delays via query param or header ✅ Custom response headers ✅ Custom JSON payloads ✅ All HTTP methods supported ✅ CORS enabled ✅ No rate limiting ✅ Global CDN delivery ## Mock API Generator ✅ Custom JSON responses (up to 10KB) ✅ All major HTTP methods (GET, POST, PUT, DELETE, PATCH) ✅ Custom status codes (200-599) ✅ Multiple authentication types (Bearer, API Key, Basic Auth, Open) ✅ Custom response headers ✅ Response delays (0-60 seconds) ✅ Hit counter tracking ✅ Auto-generated authentication tokens ✅ CORS enabled ✅ Persistent endpoints ## HTTP Tester (httpbin Alternative) ✅ 10 httpbin-like endpoints ✅ Request inspection (GET, POST, PUT, PATCH, DELETE) ✅ Header inspection endpoint ✅ Basic Auth testing endpoint ✅ Bearer token testing endpoint ✅ Status code testing (100-599) ✅ Delay testing (1-10 seconds) ✅ JSON response format ✅ CORS enabled ✅ No rate limiting ✅ Interactive web UI ## General - 100% Free Forever - No Authentication Required (for service itself) - Global CDN (Cloudflare) - < 100ms Response Time (without custom delay) - 99.99% Uptime - 200+ Global Edge Locations - CORS Enabled for All Origins - No User Data Storage - Comprehensive Logging ============================================ TECHNICAL DETAILS ============================================ **Platform**: Cloudflare Workers **Storage**: Cloudflare KV **Response Time**: < 100ms (without custom delay) **Availability**: 99.99% uptime **Global Edge Network**: 200+ Cloudflare locations **CORS**: Enabled for all origins **Security**: No sensitive data stored, tokens hashed ============================================ COMMON STATUS CODES ============================================ - 200 OK: Request succeeded - 201 Created: Resource successfully created - 204 No Content: Request succeeded with no response body - 301 Moved Permanently: Resource permanently moved - 302 Found: Resource temporarily at different URI - 400 Bad Request: Malformed request syntax - 401 Unauthorized: Authentication required - 403 Forbidden: Server refuses to authorize - 404 Not Found: Resource does not exist - 405 Method Not Allowed: HTTP method not supported - 429 Too Many Requests: Rate limit exceeded - 500 Internal Server Error: Unexpected server condition - 502 Bad Gateway: Invalid response from upstream - 503 Service Unavailable: Server temporarily unavailable - 504 Gateway Timeout: Upstream server timeout ============================================ DOCUMENTATION & SUPPORT ============================================ Website: https://free.mockerapi.com Status Code Tester: https://free.mockerapi.com/http-status-code-tester Mock API Generator: https://free.mockerapi.com/mock-api-generator HTTP Tester (httpbin Alternative): https://mockerapi.com/http-tester.html API Documentation (OpenAPI): https://free.mockerapi.com/api-docs.json Individual Status Pages: https://free.mockerapi.com/status/{code} For support and latest information, visit the website.