Echo API
Send a request, see exactly what arrived. Useful for debugging HTTP clients, proxies, SDKs, webhooks, and signed-request implementations.
https://sampleapi.top/api
Base URL — append any path below.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /get | Echo a GET request. |
| POST | /post | Echo a POST request. |
| PUT | /put | Echo a PUT request. |
| PATCH | /patch | Echo a PATCH request. |
| DELETE | /delete | Echo a DELETE request. |
| ANY | /anything | Echo any verb at this path. |
| ANY | /anything/{path...} | Echo any verb, capturing the full sub-path. |
| GET | /headers | Return just the request headers. |
| GET | /ip | Return the client IP. |
| GET | /user-agent | Return the client User-Agent. |
Echo response shape
Echo endpoints return a JSON object summarizing the request. Only safe, request-derived fields are included — no server environment, no file system info.
{
"method": "POST",
"url": "https://sampleapi.top/api/anything/widgets?ref=docs",
"path": "/api/anything/widgets?ref=docs",
"query": { "ref": "docs" },
"headers": {
"host": "sampleapi.top",
"content-type": "application/json",
"user-agent": "curl/8.5.0"
},
"body": {
"content_type": "application/json",
"kind": "json",
"parsed": { "name": "widget", "qty": 3 },
"raw": null,
"bytes": 27
},
"origin_ip": "203.0.113.42",
"user_agent": "curl/8.5.0",
"timestamp": "2024-04-12T17:21:08+00:00"
}Examples
Echo a JSON POST
curl -s -X POST https://sampleapi.top/api/anything/widgets \
-H "Content-Type: application/json" \
-H "X-Request-Id: test-123" \
-d '{"name":"widget","qty":3}'const res = await fetch('https://sampleapi.top/api/anything/widgets', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-Request-Id': 'test-123' },
body: JSON.stringify({ name: 'widget', qty: 3 })
});
console.log(await res.json());$ctx = stream_context_create(['http' => [
'method' => 'POST',
'header' => "Content-Type: application/json\r\nX-Request-Id: test-123\r\n",
'content' => json_encode(['name' => 'widget', 'qty' => 3]),
]]);
echo file_get_contents('https://sampleapi.top/api/anything/widgets', false, $ctx);Inspect what your proxy adds
curl -s https://sampleapi.top/api/headersForm-encoded body
curl -s -X POST https://sampleapi.top/api/post \
-d "name=widget&qty=3"Limits
- Request body capped at 1,048,576 bytes. Larger bodies return
413. - Multipart uploads are not supported —
body.kindwill bemultipart-unsupported. - Only request-derived fields are echoed. SampleAPI never reflects server environment variables or files.