Postguy
Guide

Code snippets

Generate cURL, raw HTTP, fetch, Python, Go, Rust, PowerShell and Node axios code from an HTTP request.

The snippet panel turns the request you are editing into code in one of eight languages. It is generated locally from the request itself. Nothing is sent.

Open the panel

  1. Press Cmd/Ctrl+K to open the palette.
  2. Type Toggle code snippet panel and run it. This toggles the right panel. The command has no keyboard shortcut.

With no request open, the panel says Open a request to see its generated code.

The panel follows the active tab's current draft, including edits you have not saved yet. The result is syntax-coloured and read-only. Use the copy button to put it on the clipboard.

Languages

The language menu lists these labels. The id is what the language argument of the snippet_generate tool takes.

IdLabel in the panel
curl (default)cURL
raw-httpRaw HTTP/1.1
fetchJavaScript (fetch)
pythonPython (requests)
goGo (net/http)
rustRust (reqwest)
powershellPowerShell
node-axiosNodeJS (axios)

Options

The gear button in the panel opens two options:

OptionValuesDefault
Indent2 spaces, 4 spaces, Tab2 spaces
Include boilerplateon / off (wraps the request in imports and a main)on

The tool takes indent (an integer from 0 to 8; 0 means a tab) and include_boilerplate. The cURL output uses a fixed style and ignores both options.

What goes into a snippet

  • Variables stay unresolved. A URL built from a base-URL variable keeps its variable reference as written. The snippet is a template you can reuse. The panel's tooltip says the resolved URL is shown in the Console. Values are never substituted, so secret variable values do not enter snippets. Text you type literally into a request does.
  • Unsupported body kinds become a comment. If a language cannot express a body kind, the snippet shows a comment instead of dropping the request. For example, Go renders form-data rows as comments and suggests a multipart.Writer.

Limits

Snippets are for HTTP requests only. gRPC and WebSocket requests have no snippet. snippet_generate answers snippet_generate supports HTTP requests only; gRPC/WS snippets are not implemented yet.

A grpcurl snippet is planned (d.grpcurl-snippet in the parity file) but does not exist yet.

Headless

snippet_generate is read-only.

  • It takes collection, request, and optionally language, indent and include_boilerplate.
  • It returns {"language": …, "snippet": …}.
  • It reads the saved request, not an unsaved draft.

See Automation tools.

Copyright © 2026