GrepBoardTools GrepBoard manuals ↗ Log ↗

Tools / Network

curl command builder

Fill in the request, copy one line. Or paste a command such as curl -sSL -X POST -d @body.json … to read it.

What you type is calculated only in your browser and is not sent to a server.

Options

Command

For bash · zsh · sh (POSIX quoting)
curl -H 'Accept: application/json' -H 'Content-Type: application/json' --data-raw '{"name":"grep","qty":2}' https://api.example.com/v1/items

What each part does

What it does

Pick the method, headers, body, authentication and options of a request to get a one-line curl command and an explanation of each option. Values are wrapped in single quotes for POSIX shells (bash, zsh, sh); a single quote inside a value becomes '\'' (close, escaped quote, reopen). In the “Explain a command” tab, paste a curl command to see each option broken down and load it back into the builder.

  • Bodies are sent with --data-raw, because -d reads a file when the value starts with @.
  • Forms use --data-urlencode (the value is percent-encoded); multipart uses --form-string (literal text) and -F name=@path (a file).
  • A header with an empty value is written -H 'Name;' — -H 'Name:' tells curl to remove that header.
  • When the URL contains [ ] { }, -g turns off curl’s URL globbing.

Examples

ChoiceCommand
POST · JSON {"a":1}curl -H 'Content-Type: application/json' --data-raw '{"a":1}' https://api.example.com/
Header value it'scurl -H 'X-Note: it'\''s' https://example.com/
Basic auth alice / s3cr3tcurl -u alice:s3cr3t https://example.com/
HEAD · follow · 10 scurl -I -L --max-time 10 https://example.com/
Form q = a&bcurl --data-urlencode 'q=a&b' https://example.com/form

Common mistakes

  • -X POST -d … with -L: a method set with -X is kept after redirects. With a body, curl sends POST anyway, so -X POST can be dropped (this tool drops it).
  • -X HEAD: curl waits for a body that never arrives. Use -I.
  • JSON in double quotes: in "…$HOME…" the shell replaces $ and ` `` first. Use single quotes.
  • --data with -G: with -G the data is appended to the URL as a query string instead of the body.

How the check was made

43 generated commands were run through bash with real curl 8.5.0 against a small echo server on 127.0.0.1; the method, path, headers, body and credentials the server received matched the input in every case (including values with single quotes, $, backticks, Korean text and line breaks, redirects, and exit code 28 on timeout). Every generated option was checked against curl --help all. For the explainer, word splitting was compared with bash in 7 cases and the explanation with the request curl actually sent in 12 cases. The option descriptions come from curl --help all of curl 8.5.0 (258 options).

FAQ

Does it work in Windows cmd or PowerShell?

No. Quoting rules differ, so the commands are for POSIX shells such as bash, zsh and sh. On Windows, run them in WSL or Git Bash. In PowerShell, curl can be an alias of Invoke-WebRequest depending on the version; call curl.exe instead.

Can it explain “Copy as cURL” from browser dev tools?

Yes — paste the bash version (including $'…' quoting) as is. The cmd version (with ^ at line ends) is not understood. Copied commands often contain cookies or tokens; remove them before sharing.

Is my token or password sent to a server?

No. The command is built in your browser; the input is not sent to a server and is not put in the address bar or passed to the visitor statistics or ads. The tool never sends the request itself. Details are on the privacy page.