cURL Generator

Compose a copy-pasteable, shell-escaped curl command from a method, URL, headers and body.

  • Runs locally in your browser
  • No upload required

Try it

Command
curl -X GET 'https://api.example.com/items' -H 'Content-Type: application/json' --data-raw '{"name":"widget"}'
Arguments
8

Supported formats

Input
text, select, boolean
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Built a curl command with 11 argument(s).

How it works

  • Selected the method with -X and single-quote escaped the URL.
  • Appended -L, -k and --compressed only when the matching options were enabled.
  • Converted each header line to a -H argument with its name and trimmed value.
  • Added --data-raw with the body when a body was supplied.
  • Everything is single-quote escaped, so characters such as $, ` and " stay literal inside the shell.
  • The tool only builds the command text; it does not run curl or make any network request.

Methodology

  1. Start the argument list with curl, -X and the upper-cased method.
  2. Single-quote escape the absolute URL and append the -L, -k and --compressed flags when enabled.
  3. Parse the header block into `Name: value` lines, trim the value and append each as a -H argument.
  4. Append --data-raw with the body when the body is non-empty.
  5. Join the arguments with spaces to form the final command.

Usage

  1. Choose the HTTP method and enter an absolute http(s) URL.
  2. Add one header per line as `Name: value`.
  3. Optionally add a body and toggle the redirect, insecure and compression flags.
  4. Copy the generated command and paste it into a POSIX shell.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

POST JSON with a header

jsonSelect to copy
{
  "method": "POST",
  "url": "https://api.example.com/items",
  "headers": "Content-Type: application/json\nAuthorization: Bearer token",
  "body": "{\"name\":\"widget\"}",
  "followRedirects": true,
  "insecure": false,
  "compressed": false
}

Simple GET

jsonSelect to copy
{
  "method": "GET",
  "url": "https://example.com/search?q=hello world",
  "headers": "",
  "body": "",
  "followRedirects": false,
  "insecure": false,
  "compressed": true
}

Limitations

Shell safety

An unquoted URL or header value containing a space, a semicolon or a dollar sign can be re-interpreted by the shell. The generator single-quote escapes every dynamic value, which makes the command inert: the shell passes the literal bytes to curl. Review a command you did not build before running it, especially when it carries an Authorization header.

What is not generated

The tool does not generate multipart uploads, client certificates, cookies from a jar, or authentication handshakes that need a prior request. Those flows are explicit state, and hiding them inside a one-line generator would be misleading.

Frequently asked questions

Will the generated command run my request automatically?
No. The page only produces the command text. You decide when and where to run it; nothing is sent from this page.
How is quoting handled?
Every dynamic value is wrapped in single quotes and an embedded single quote becomes '\''. That is the portable POSIX escape, so an URL with spaces or a body with $ and backticks stays literal.
Can I use this command in Windows PowerShell?
The tokens are valid, but Windows shells treat single quotes differently. Prefer a POSIX shell (bash, zsh, sh) or rewrite the quoting for your shell.

Sources

  1. RFC 9110 — HTTP Semantics — IETF
  2. curl — command line options — curl project