Copy as cURL, HTTPie, fetch, Python, PowerShell

Show any request as a command or as code: to run it elsewhere, paste it into a bug report or hand it to a developer.

From the request editor

Copy as… in the request editor opens the dialog. Pick the format:

FormatGives
cURLA curl command
HTTPieAn http command (HTTPie 3 for --raw)
fetchJavaScript fetch()
PythonThe requests package
PowerShellInvoke-RestMethod (PowerShell 7 for -Form)

For commands, pick the shell too: bash / zsh (Linux, macOS, Git Bash), PowerShell (the default on Windows, which runs curl.exe) or cmd. Copy it with the icon next to it; the format and shell you used are remembered.

The Copy as dialog with a curl command for the Log in request
Copy as… on the tutorial's Log in request.

From the run log

The copy icon at the end of each request line in the log opens the same dialog with what that request actually sent in the run: the values it had after the steps before it (a token from a login step, an id created earlier, the cookies the run sent). It works for requests made from code too, and for requests that failed (a timeout, a refused connection). CLEM keeps the requests of the last 10 runs.

A request copied from the log contains the credentials the run sent, and they may have expired. The notes say so.

Secrets and tokens

Secret values are never copied: a secret becomes a reference to the environment variable CLEM_<name> (the one exported flows read), so set it before running the command. OAuth 2.0 tokens aren't copied either: the command reads ACCESS_TOKEN instead.

export CLEM_token=…   # bash; cmd: set CLEM_token=…
curl 'https://api.example.com/me' \
  -H 'Authorization: Bearer '"$CLEM_token" \
  -L

A PowerShell command with double quotes (a JSON body) starts with curl.exe --%, so Windows PowerShell 5.1 passes them on unchanged. When an argument can't follow --% (it has a line break, a |, or a literal %NAME% that PowerShell would expand), the command is written without it and a note says to use PowerShell 7.3 or later, or the cmd version.

A URL with a % that isn't followed by two hex digits (?discount=10%) is sent as written. Python's requests re-encodes such a URL as a whole, so its other escapes change; the Python snippet's note says so. Write a literal % as %25.