curl Command Generator — Build & Decode curl Requests
Stop hunting for the right curl flags. Pick the method, headers, body and auth
and get the exact command — with every flag explained. Or paste a curl
command to decode it. Everything stays in your browser.
Your command
—
Or: decode a curl command
Paste any curl command — every flag gets explained.
The shape of a curl request
Every curl call is the same skeleton: an optional method
(-X POST), zero or more headers (-H 'Header: value'), an
optional body (-d '…'), some flags, and the
URL last. curl https://example.com with nothing else is a plain GET.
The two that confuse people
-dturns a request into a POST automatically. You don't need-X POSTwhen you send-d— curl assumes POST. Add-Xonly to force a different method likePUTorPATCH.- JSON needs its Content-Type header. Sending
-d '{"a":1}'without-H 'Content-Type: application/json'makes curl send it as form data, and many APIs reject it. The builder adds the header for you when you pick JSON.
Gotchas worth knowing
- Quote everything. Wrap the URL, headers and JSON body in single quotes so the
shell doesn't mangle
&,?, spaces or{}. Inside JSON, single quotes around the whole body let you use double quotes freely. -ivs-v.-ishows the response headers in the output;-vshows the whole conversation including what curl sent — use-vwhen debugging why a request fails.-Lfor anything that redirects. Without it, hitting a URL that returns a 301/302 just prints the redirect, not the final page. APIs and shortened links usually need it.- Don't paste real tokens into shared terminals. A bearer token in your shell history is a credential — treat it like a password.
Frequently asked questions
How do I send a POST request with JSON using curl?
curl -X POST -H 'Content-Type: application/json' -d '{"name":"Ada"}'
https://api.example.com. The header tells the server it's JSON; -d carries the
body.
How do I add a bearer token to a curl request?
Add the header -H 'Authorization: Bearer YOUR_TOKEN'. The builder above does this when
you fill in the bearer token field.
What does curl -i do?
-i includes the response's HTTP headers in the output, so you can see the status code
and headers along with the body. Use -v to also see the request you sent.
Why does my curl POST get sent as form data?
Because -d defaults to application/x-www-form-urlencoded. Add
-H 'Content-Type: application/json' to send JSON instead.
Working in the shell? See the tar, find and rsync generators, or all tools on the home page.