03 / API & Auth / curl-generator
cURL Command Generator
Build cURL commands for API requests.
How to use
- 01Choose the HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD or OPTIONS) and enter the request URL.
- 02Edit the default Content-Type and Authorization headers, add more with Add header, or remove rows with the trash button.
- 03For methods other than GET and HEAD, paste a request body; it is sent with -d.
- 04Toggle follow redirects (-L, on by default), verbose (-v) and insecure (-k) as needed.
- 05Press Copy command and paste it into your terminal.
What is this tool?
Builds a correctly quoted, multi-line cURL command from a simple form: method, URL, headers, an optional request body and the -L, -v and -k flags. The URL, each header and the body are wrapped in single quotes and shell-escaped, so payloads containing quotes stay intact. The command updates as you type, and nothing is sent: it only generates text.
How the generated cURL command is quoted
Every value goes inside single quotes, which stop bash and zsh from expanding $variables, backticks and ! history references. A single quote inside a value cannot be escaped within single quotes, so the generator closes the quote, adds an escaped quote and reopens it: a body of {"note":"it's fine"} becomes -d '{"note":"it'\''s fine"}'. Each part is placed on its own line ending in a backslash, so long commands stay readable and still run as one.
This quoting targets POSIX shells such as bash and zsh on macOS, Linux, WSL and Git Bash. Windows cmd.exe and PowerShell use different quoting and line-continuation rules, so run the command in one of those shells instead.
cURL flags used: -X, -H, -d, -L, -v and -k
-X sets the method and -H adds one header per row; rows with an empty name are skipped. -d sends the body, trimmed of leading and trailing whitespace, and is only included for methods other than GET and HEAD. Note that -d on its own makes curl send Content-Type: application/x-www-form-urlencoded, which is why the Content-Type: application/json header row matters for JSON APIs.
-L follows 3xx redirects, -v prints the request and response headers plus TLS details to help with debugging, and -k skips TLS certificate verification. Use -k only against local or test servers with self-signed certificates, never as a fix for production certificate errors. For HEAD requests, be aware that curl -X HEAD can wait for a body that never arrives; curl -I is the safer way to send a HEAD request by hand.
Common cURL mistakes this avoids
Hand-written curl commands often break in predictable ways: double quotes around JSON that let the shell eat the inner quotes, a missing backslash at the end of a line that silently drops every flag after it, or a JSON body sent without a Content-Type header. Building the command from a form avoids all three.
The generator always writes -X with the method, even for POST with a body where curl would infer it. That is harmless and keeps the method obvious to whoever reads the command in a bug report. Remember to replace placeholder values such as Bearer <token> before running it.
Common use cases
- Sharing reproducible API requests with teammates
- Documenting endpoints in a bug report
- Quickly testing an endpoint from the terminal
- Building requests for CI smoke tests
- Debugging redirects or TLS issues with -L and -v
FAQ
Is the body escaped safely?
Yes. The body is wrapped in single quotes and any single quotes inside it are escaped for POSIX shells, so JSON with apostrophes stays intact.
Does it send the request?
No, it only builds the command text.
Are my tokens stored?
No, nothing leaves the page.
Which shells are supported?
The output targets bash, zsh and other POSIX shells. Windows cmd.exe and PowerShell quote differently, so use WSL or Git Bash on Windows.
How do I send JSON with curl?
Choose POST, PUT or PATCH, keep the Content-Type: application/json header and paste the JSON into the request body. The generator adds it with -d.
Why is there no body field for GET requests?
The body field is hidden for GET and HEAD, which do not normally carry a request body. Put GET parameters in the URL's query string instead.
What does curl -k do?
It disables TLS certificate verification. Use it only for local or test servers with self-signed certificates.