DEV Community

Rails Designer
Rails Designer

Posted on • Originally published at railsdesigner.com

New: Test and send webhooks and API requests in development

This article was originally published on the Rails Designer Blog


Testing webhooks locally is painful. Services like ngrok and webhook.site require internet connectivity, send your data through external servers and add network latency to every request. Requestkit runs entirely on your machine. It's a local HTTP server that captures incoming webhooks (from Stripe, GitHub, Shopify, etc.) and lets you send API requests.

Unlike online tools, Requestkit is fast, requires zero configuration and configuration can be easily shared within projects. Install it as a Ruby gem, start the server and point your webhooks to localhost:4000.

⭐ Star the project on GitHub ⭐

What is Requestkit?

Requestkit is a local HTTP request toolkit for development. Sounds fancy, but what can it do?

  • See webhook payloads: view complete headers and body data for every request in a clean web interface;
  • Send API requests: test outbound HTTP calls to external services and inspect their responses;
  • Organize by namespace: automatically groups requests by URL path (e.g., /stripe, /github) for easy filtering;
  • Persist across restarts: optional file storage keeps your request history between sessions.

How it works

Requestkit runs as a local web server on your machine (default: http://localhost:4000). When you send any HTTP request to it, whether from a curl command, a webhook testing tool or a third-party service, Requestkit captures the complete request including headers and body, then stores it for inspection. Open the web interface in your browser to see all captured requests organized by namespace, with full details available at a glance.

The tool uses SQLite for storage, giving you the choice between in-memory mode (fast, temporary) or file-based persistence. You can configure defaults via YAML files at the user or project level and override them with CLI flags. Namespaces are automatically extracted from URL paths, so /stripe/webhook goes into the "stripe" namespace while /github/push goes into "github".

In short:

  • Install via gem install requestkit;
  • Start with requestkit (or customize port/storage with flags);
  • Send requests to http://localhost:4000/your-namespace/path;
  • View everything in your browser at http://localhost:4000.

Behind the scenes

Requestkit is built with Ruby and uses some interesting tools. It uses Ruby Async with Server-Sent Events (SSE) to push new requests to the browser instantly, so the codebase stays lightweight and dependencies minimal. The server itself runs on async-http, which handles concurrent connections efficiently without the overhead of a full web framework.

Storage is handled by SQLite3 with a simple schema that tracks request direction (inbound vs. outbound), namespaces, timestamps and parent relationships for request/response pairs. The web UI is a single ERB template with vanilla CSS (built with tailwindcss-ruby. No JavaScript frameworks, but using Attractive.js for the odd interactivity. For outbound requests, Requestkit uses async-http with custom SSL contexts to handle HTTPS endpoints.

⭐ Explore the code and contribute on GitHub (don't forget to star the repo! 😊)

Top comments (0)