How to build — or take apart — a cURL command
This cURL builder turns a form into a correct, copy-ready curl command: choose the method and URL, add headers, a body, authentication and common flags, and the command updates as you type, neatly split across lines. It also works in reverse — paste an existing cURL command (for example from your browser's "Copy as cURL" or from API documentation) and it is broken back down into editable fields.
Quoting is handled for you, so values containing spaces, quotes or JSON come out safe to paste into a terminal. Nothing is sent anywhere: the tool only writes the command, it doesn't execute requests.
How to use the cURL builder
- Choose the HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS) and enter the URL.
- On the Headers tab add key/value pairs — common names and values such as
Content-Type: application/jsonare suggested. - On the Body tab choose raw (JSON or text),
multipart/form-dataorx-www-form-urlencoded. For a raw JSON body, theContent-Typeheader is added automatically if you haven't set one. - On the Auth tab add Basic credentials (as
-uor as anAuthorizationheader) or a Bearer token. - On Options toggle flags like
-L(follow redirects),-i(show response headers),-k(skip TLS verification),-v(verbose) or a--proxy, and optionally pipe the output tojq. - Copy the generated command. To edit an existing command instead, click Import cURL and paste it.
A POST with a JSON body and bearer token comes out like this:
curl -X POST 'https://api.example.com/v1/orders' \
-H 'Authorization: Bearer eyJhbGciOi…' \
-H 'Content-Type: application/json' \
--data-raw '{"sku":"A-100","qty":2}'The cURL flags you'll use most
| Flag | Purpose |
|---|---|
-X POST | Set the HTTP method (GET is the default; -d implies POST) |
-H 'Name: value' | Add a request header |
-d / --data-raw | Send a request body; --data-raw doesn't treat a leading @ as a filename |
--data-urlencode 'k=v' | URL-encode a form field for you |
-F 'file=@photo.jpg' | Send multipart form data, including file uploads |
-u user:pass | HTTP Basic authentication |
-L | Follow redirects |
-i / -v | Include response headers / show the full request and response exchange |
-k | Skip TLS certificate verification — for local testing only |
-x / --proxy | Send the request through a proxy |
Common problems
- Quotes break the command. In bash and zsh, single quotes are safest; a single quote inside the value must be written as
'\''. The builder escapes this for you. Windowscmd.exedoesn't support single quotes at all — use PowerShell or Git Bash, or replace with escaped double quotes. - 415 Unsupported Media Type. The server didn't get the
Content-Typeit expects. AddContent-Type: application/jsonfor JSON bodies. - Body sent as form data instead of JSON.
-dwithout a content type sendsapplication/x-www-form-urlencoded. Set the header explicitly. - Redirect returns an empty body. Add
-L; by default curl doesn't follow301/302responses. curl: (60) SSL certificate problem. The server's certificate isn't trusted. Fix the certificate chain; use-konly against local or test servers.
Keeping credentials safe
A command copied from DevTools often contains live cookies and tokens. Deconstructing it here is safe because nothing leaves your browser, but be careful where you paste the result afterwards — shell history, chat and tickets keep it. Prefer environment variables in shared commands, e.g. -H "Authorization: Bearer $API_TOKEN". To inspect a token you find in a command, use the JWT decoder; to prepare a JSON body, use the JSON formatter.
Frequently asked questions
Does this tool send the request?
No. It only generates and parses cURL commands in your browser. Run the command yourself in a terminal.
Can I import a command from Chrome DevTools?
Yes. In the Network panel, right-click a request and choose Copy → Copy as cURL (bash), then click Import cURL and paste it. Method, URL, headers, body, auth and common flags are extracted into fields.
What's the difference between -d and --data-raw?
Both send a request body. With -d, a value starting with @ is read from a file; --data-raw sends the text exactly as written.
How do I send JSON with curl?
Use -X POST, add -H 'Content-Type: application/json' and pass the JSON with --data-raw '{"key":"value"}'. Choose the raw JSON body type in the builder and it does all three.