How to simulate a slow webhook endpoint and test timeouts
The quick answer: https://webhook.plus/delay/8 waits 8 seconds and then echoes the request. Point a sender at it to learn its timeout: if the sender reports a timeout before 8 seconds, its limit is shorter than that.
Which endpoints add a delay?
| Endpoint | Behaviour |
|---|---|
/delay/{seconds} | Waits, then returns 200 with the request echo. Fractions like /delay/2.5 work. |
/reply?delay=6&status=200 | Waits, then returns the status, body and headers you choose. |
/drip?numbytes=10&duration=8 | Sends the body a byte at a time, to test read timeouts. |
The maximum delay is 10 seconds per request.
How do I find a sender's timeout?
- Start at
/delay/2and send a test event. It should succeed. - Step up:
/delay/5,/delay/8,/delay/10. - The first delay that the sender logs as a timeout brackets its limit.
How do I time it myself?
curl -s -o /dev/null -w 'total: %{time_total}s\n' https://webhook.plus/delay/3
total: 3.1s
curl --max-time 2 https://webhook.plus/delay/5
curl: (28) Operation timed out after 2001 milliseconds
What does a timeout mean for my handler?
A sender that times out usually treats the delivery as failed and retries, even if your handler finished the work. That's how duplicates happen. Two habits avoid it:
- Acknowledge fast. Validate, store the event, return 2xx, and process it in a background job.
- Be idempotent. Deduplicate by event ID so a retry of a slow delivery doesn't repeat side effects.
Related: testing retries and failure responses.