Skip to content

cURL in and out ​

Paste a cURL command to open it as a request tab, and copy any request as a cURL command to run in a terminal.

What cURL is ​

cURL is a command-line program that sends HTTP requests. API documentation often shows examples as curl commands, and browsers can copy any request as one. That makes cURL a handy way to move a single request between tools.

bash
curl -X POST 'https://api.example.com/users' \
  -H 'Content-Type: application/json' \
  -d '{"name": "Ada"}'

Import a cURL command ​

  1. Open any HTTP request tab.

  2. Select the More menu (the three dots next to Send) and choose Import cURL….

  3. Paste the command into the box. It must start with curl.

  4. Select Import.

    The request opens in a new tab, ready to send or save.

To get a command from a browser: open the developer tools, go to the Network tab, right-click a request and choose the option that copies it as cURL.

What is understood ​

cURL optionBecomes
The bare URL, or --urlThe request URL.
-X, --requestThe method.
-H, --headerA header row.
-d, --data, --data-raw, --data-binaryThe body. The method becomes POST unless -X says otherwise.
--data-urlencodeA form-urlencoded field.
-u, --userBasic auth, with the user name and password.

The body type follows the Content-Type header: JSON for a JSON type, form-urlencoded for a form type, and text otherwise.

These options are accepted and ignored: -L, --location, -s, --silent, -k, --insecure and --compressed.

WARNING

Multipart form fields (-F, --form) are not imported. Add them by hand on the Body tab after importing. See Request body.

If the command has no URL, or does not start with curl, the app says "Could not parse that cURL command."

Copy a request as cURL ​

  1. Open the request.

  2. Select the More menu and choose Copy as cURL.

    The command is copied to the clipboard.

  3. Paste it into a terminal, a chat or a bug report.

Copy as cURL keeps the request as you wrote it:

  • Variables stay as {{name}}, so the command is safe to share but needs the values filled in before it runs.
  • Bearer, Basic and API key (in a header) auth are included.
  • Other auth types, which sign the final request, are not included.

Get a ready-to-run command ​

To get a command with the variables and every auth type filled in, use the code snippet dialog instead:

  1. Select the More menu and choose Code snippet….

  2. Leave Language on the first entry, Shell – cURL.

  3. Select Copy.

DANGER

A resolved command contains your real tokens and passwords. Check it before you paste it anywhere others can read.

See Code snippets for the other languages.

Next steps ​