How to build a Postman alternative

How to build a Postman alternative with saved HTTP requests, a guarded send service, response limits, and redacted history. Test boundaries before deployment.

  • guide
  • vibe-coding

How to build a Postman alternative begins with the requests you send every week. We will build Reqbook, a private collection of HTTP requests with an editor and a response pane. The Postman catalog page provides the broader prompt and related alternatives.

Our first version supports a deliberately small set of approved API hosts. You save a request, inspect the resolved URL, press Send, and read the response. The Postman post explains why collections alone can be useful without mock servers or a public API network.

This is a server-hosted tool. Sending arbitrary user URLs through your server creates a route into networks the user cannot otherwise reach. We will treat destination validation as part of Send from the beginning. A local desktop client would need a different network policy.

How to build a Postman alternative for approved APIs

Use Astro server rendering, Alpine for the request editor tabs, and ordinary server endpoints for persistence and sending. HTMX can refresh the collection list after a save. D1 stores collections and request definitions. A separate server-side sender executes outbound HTTP with an allowlist and hard resource limits.

Start with GET and POST, query parameters, explicit headers, and a JSON or text body. Add other methods after you have a reason to use them. Keep environment variables and execution history as later prompts. There is no need to build a scripting sandbox to send a JSON request.

Draw the trust boundary

The browser submits a saved request id and optional edits. The server loads that request for the current owner, resolves variables, validates the destination, and constructs a fresh outbound request. It never forwards the inbound browser headers wholesale.

Private editorRequest ID Destination policyAllowlisted origin Bounded senderNo redirects Approved APIResponse cap
The server applies its own policy before contacting the destination.

Step 1 Save collections and request definitions

A collection belongs to one owner. A request belongs to a collection and stores a name, method, URL template, ordered query entries, headers, body type, and body text. Keep query parameters as an ordered list because duplicate keys can be meaningful.

Separate Save from Send. Editing a field should not contact the target API. A request definition is a draft that you can inspect and change without causing remote side effects. Give both buttons clear labels and keep keyboard submission from accidentally selecting Send.

Build Reqbook with authenticated owners, collections, and saved requests. Use
versioned migrations. Store query entries as an ordered list and preserve repeated
keys. Support GET and POST with text or JSON bodies. Saving never sends a request.
Enforce owner access on every route. Add create, rename, move, and delete forms
with server validation and recoverable error messages.

Check an empty collection, a long request name, and two query entries with the same key. Save, reload, and compare the entries byte for byte. Try another owner’s request id in the URL. The server should return the same unavailable response it uses for a missing request.

Step 2 Resolve the request before sending

Use explicit variables such as {{base_url}} and {{project_id}}. Resolve them only from the selected environment. Missing variables are an error. Never replace an unknown variable with an empty string, because that can send credentials to an unintended path or host.

Show a preview of the resolved method, URL, and body. Hide secret values in the preview while showing which named secret will be used. Keep secrets in a server-side secret store and persist references in D1. Do not copy raw tokens into request JSON, exports, logs, or browser storage.

Add environment resolution with explicit missing-variable errors. Resolve a
request into an immutable execution snapshot before Send. Store secret references
separately from ordinary environment values. Preview secret names with masked
values. Require a selected environment and show the resolved origin prominently.
Do not execute JavaScript templates or evaluate expressions.

Create staging and production environments using a local test responder for development. Switch environments and verify the origin shown above Send changes. Remove a required variable and confirm the sender receives no request. Put braces in a normal JSON string and verify the documented escaping behavior rather than silently interpreting everything as a variable.

Step 3 Implement destination policy

For the hosted v1, use administrator-approved HTTPS origins and paths. Reject embedded credentials, nonstandard ports unless explicitly approved, IP literal destinations, local hostnames, and destinations outside the allowlist. Disable redirects entirely. A public API that redirects can be supported later with fresh validation for every hop.

Resolve approved hosts and enforce an egress policy that refuses private, loopback, link-local, reserved, and internal destinations for IPv4 and IPv6. Checking a DNS answer and then letting a separate connection resolve again leaves a rebinding gap. Use a network layer that connects to the validated address while preserving correct TLS hostname verification, or a restricted egress service that enforces that boundary. If your chosen runtime cannot provide that guarantee, keep the destination set under deployment control and use an egress service before opening it to untrusted users.

Implement Send behind an administrator-controlled origin and path allowlist.
Allow HTTPS only. Disable redirects and ambient cookie forwarding. Enforce public
network egress on the actual connection, including IPv6 and DNS changes. Reject
unsupported runtimes rather than silently weakening this rule. Build a fake
transport for policy tests and document how production enforces egress.

Test a localhost URL, a link-local address, an IPv6 loopback address, a public URL redirecting to a private address, and a hostname resolving differently between checks. Each must fail before any private connection. Consult the OWASP SSRF prevention guidance when reviewing this implementation.

Step 4 Bound execution and display responses safely

Set a connection deadline, a total deadline, and a maximum response size. These are application policy choices; write the actual values in the settings page and README. Read response streams incrementally and cancel once the byte cap is reached. Do not buffer an unlimited body before checking its size.

Render all response content as escaped text. A response labeled HTML stays text in the pane. Display status, permitted headers, elapsed time, and whether the body was truncated. A JSON formatting error should fall back to raw text without losing the original result.

Add bounded response streaming with total timeout, byte cap, cancellation, and
explicit truncation status. Show response status, headers, duration, and escaped
body text. Never execute HTML or scripts from a response. Strip hop-by-hop and
transport-controlled request headers. Never forward the browser session cookie.
Distinguish network failure from an HTTP response with an error status.

Point the test sender at a responder that delays, streams forever, returns malformed JSON, and sends HTML with a script tag. The UI must stay usable after each case. A 404 response belongs in the result pane with its actual status; a connection timeout belongs in an execution error state.

Step 5 Keep useful history without preserving credentials

History records what was sent, not whatever the editor currently contains. Store the request version, method, redacted URL, response status, duration, and completion reason. Default to omitting response bodies because API responses can contain personal data and tokens.

Decide which query keys and header names are sensitive. A generic redactor cannot recognize every secret buried in arbitrary text. Let the owner mark fields secret and omit raw request bodies from history by default. If they deliberately save a body, make retention and deletion controls visible.

Record execution history from the resolved snapshot. Redact secret headers,
secret query values, and named secret variables. Omit request and response bodies
by default. Add retention expiry and owner-controlled deletion. History detail
must enforce the same ownership checks as collections. Exports contain references,
never raw secrets. Do not retry POST automatically.

Send a fixture containing an authorization value and a secret query parameter. Search the database dump and diagnostic logs for those values. They should be absent. Then edit the request URL and reopen the previous execution; its redacted snapshot should still describe the old send.

Step 6 Deploy behind authentication

Keep the application private. Configure one identity provider or an access gateway, then verify that the application checks the authenticated identity itself. A hidden URL is not access control. Mutation endpoints need CSRF protection and per-owner rate limits.

Create the production database and apply migrations with the normal project deployment commands. Configure secrets through the hosting platform. For an Astro deployment on Cloudflare, use the runtime adapter supported by the installed Astro version and follow its current deployment documentation. Do not assume a Node-specific networking package works unchanged in Workers.

Before deployment, run policy tests against the production sender implementation, not just the fake adapter. After deployment, save a test request, reload it, send it to your approved responder, and verify history. Sign out and try the send route directly. It must fail without contacting the responder.

Diagnose common failures

If every request fails, start with allowlist configuration and egress logs. Keep the blocked origin visible, while masking credentials. If the API responds with 401, inspect whether the selected secret reference resolves on the server; never expose the token in an error page.

If the browser reports a network error while the server saw a normal response, inspect your own response serialization and size limits. The server-side sender avoids target API CORS restrictions, but your editor still needs a valid response from its own origin. If requests appear twice, check button disabling and request identifiers before adding retries.

The Zapier guide covers a related outbound-action workflow. Keep Reqbook manual until the guarded Send path is dependable. Copy the Postman prompt, choose one approved API, and leave monitors, mock servers, collaborative editing, and script execution for a later project.

Related articles

Read all articles →