Skip to content

Code Generation

Thiago Miranda edited this page Jun 15, 2026 · 1 revision

Code Generation

Turn the current request into copy-pasteable code for another language or tool.

Opening the dialog

Use the Generate code action in the URL bar (the </> code icon; on narrow widths it's in the overflow menu). A dialog opens with a target dropdown, a live preview, and COPY / CLOSE buttons.

Targets

Target Output
cURL A curl command (default)
JavaScript — fetch Browser fetch() call
Node.js — axios axios request (uses form-data for multipart)
Python — requests requests call
Go — net/http A runnable main using the standard library
Java — OkHttp An OkHttp Request / Response

Pick a target and the preview updates instantly. COPY puts it on the clipboard.

What's reflected

  • Method, URL, headers, and body from the request.
  • Auth (Authentication): bearer/basic become an Authorization header; API key becomes a header or query parameter — matching how the request would actually be sent.
  • Content-Type consistent with the Building Requests (urlencoded, octet-stream for binary, multipart handled by the language's form encoder).
  • Body shape per type: raw verbatim; urlencoded as k=v&…; multipart via the target's form API (file parts are noted as comments where a language can't inline a file); binary as a file reference.

Variables stay templated

{{variables}} are left un-interpolated in the generated code, so you can paste the snippet and wire in your own secrets/values. (If you want resolved values, define them in the active Environments and Variables — but the export deliberately preserves the placeholders.)

Adding more targets

New targets are easy to add in the codebase (each is a small formatter; the export dialog lists them automatically). If you'd like another language, open an issue or PR — see Building from Source.

Clone this wiki locally