Replaying Requests
How Replay Works
The replay feature re-sends a captured webhook request to your endpoint. When you click "Replay" on any request in the dashboard, ReqPour creates a new HTTP request with the exact same method, headers, and body as the original, and sends it to your endpoint.
If a relay is active (you are running npx reqpour relay --to ...), the replayed request is forwarded to your local server just like any other incoming request. Your handler processes it, and the response appears in the dashboard.
Replay creates a new entry in your request feed. This means you can compare the original request with the replayed one, and see how your handler responded to each. The replayed request is tagged with a replay indicator so you can distinguish it from original webhook deliveries.
Iterative Development with Replay
Replay transforms the webhook development workflow. Instead of the slow cycle of "trigger real event > wait for webhook > check handler > modify code > trigger another real event," you can:
1. Trigger one real webhook event (e.g., make a test payment in Stripe) 2. See it captured in the ReqPour dashboard 3. Start your relay and write your handler 4. Replay the captured event to test your handler 5. See the response, fix any issues, replay again 6. Repeat steps 4-5 until your handler works correctly
This is dramatically faster than triggering real events each time, especially for events that are slow or complex to trigger (like subscription renewals, email bounces, or deployment completions).
Replay is also useful for testing idempotency. Replay the same event multiple times and verify your handler correctly detects and skips duplicate events.
Replay with Modifications
Sometimes you need to test variations of a captured event. The API supports replay with header and body overrides:
curl -X POST https://api.reqpour.com/endpoints/EP_ID/requests/REQ_ID/replay \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"bodyOverrides": {
"type": "payment_intent.failed"
}
}'This replays the captured request but changes the event type. Your handler receives the modified payload, letting you test different event types using the same base payload.
Note that modifying the body will invalidate the original webhook signature. If your handler verifies signatures, it will reject the modified replay. During development, you may want to temporarily skip signature verification when testing with modified payloads.
Building a Test Suite from Replays
Over time, your ReqPour request history becomes a library of real webhook payloads. You can use these as the basis for an automated test suite.
Export captured requests from the API and save them as JSON fixtures in your test directory. Each fixture represents a real-world webhook payload that you have verified works with your handler.
# Fetch a captured request
curl https://api.reqpour.com/endpoints/EP_ID/requests/REQ_ID \
-H "Authorization: Bearer YOUR_TOKEN" \
> test/fixtures/stripe-payment-succeeded.jsonUse these fixtures in your unit and integration tests. When the provider changes their webhook format, capture new payloads through ReqPour and update your fixtures. This keeps your tests aligned with real-world data.
Replay Best Practices
Replay frequently during development. The faster your feedback loop, the faster you build correct webhook handlers. Instead of spending time creating test events in provider dashboards, trigger one event and replay it throughout your development session.
Be mindful of side effects. If your handler sends emails, charges payments, or calls external APIs, replaying will trigger these side effects again. Use conditional logic or environment variables to disable side effects during development:
if (process.env.NODE_ENV !== 'development') {
await sendConfirmationEmail(customer);
}Organize your replays by tagging important requests in the dashboard. Tag representative payloads for each event type you handle: "stripe-payment-success," "github-push," "shopify-order-create." This creates a curated collection of test payloads you can replay anytime.
Related
Get started with ReqPour
Catch, inspect, and relay webhooks to localhost. Free to start, $3/mo for Pro.