curl Command Builder
Build a request, or paste one to edit it, then copy it as curl, fetch or Python.
Free · No signupNothing is sent from this page
Query parameters 1 in the URL
curl 'https://api.example.com/v1/users?page=1' \ -H 'Accept: application/json'
Getting the builder ready…
Describe it instead of memorising flags
Ask CtrlOps’ AI Terminal for the command.
It explains each command before you approve it, inside the SSH workspace where you run it.
Keep it handy
The flags
you will use most.
A curl command is curl [options] URL. These options cover most API calls, health checks and scripts.
| Flag | What it does |
|---|---|
-X, --request | Set the method. curl picks POST by itself when you send data. |
-H, --header | Add a header. Repeat it for each one. |
--data-raw | Send the body exactly as written. Safe for JSON. |
-d, --data | Send a body; a value starting with @ reads a file. |
--data-urlencode | Send a form field, URL-encoding the value for you. |
-F, --form | Send multipart form data; @path uploads a file. |
-u, --user | HTTP Basic auth as user:password. |
-L, --location | Follow redirects. |
-f, --fail | Exit with an error on HTTP 400 and above. Use it in scripts. |
-sS | Hide the progress bar but still show errors. |
-i, --include | Print the response headers too. |
-v, --verbose | Show the full request and response for debugging. |
-o, --output | Save the response to a file. |
-k, --insecure | Skip TLS certificate checks. Test servers only. |
--max-time | Give up after this many seconds in total. |
Getting it right
Small flags.
Big differences.
Let curl choose the method
curl sends GET by default and POST when you send data. Add -X only for PUT, PATCH, DELETE and the like. -X POST next to -L also forces POST after a redirect, which is rarely what you want.
Send the body you mean
Use --data-raw for JSON so a leading @ is never read as a file name, and set Content-Type: application/json; plain -d labels the body as a form. --data-urlencode encodes form values for you, and -F uploads files as multipart.
Keep secrets out of history
A token typed into a command ends up in ~/.bash_history. Export it first and reference it in double quotes, as in -H "Authorization: Bearer ${API_TOKEN}". The builder can write every output this way.
Make scripts fail loudly
By default curl exits successfully even on a 500. -f turns HTTP errors into a non-zero exit, -sS keeps logs clean but shows errors, and --max-time stops a request from hanging a cron job or deploy.
Common questions
curl,
explained.
How do I send a POST request with a JSON body in curl?
Use -X POST, add -H "Content-Type: application/json", and send the payload with --data-raw '{"key":"value"}'. In this builder, choose POST, pick the JSON body type, and paste your JSON - the Content-Type header is added automatically.
How do I add a bearer token or auth header to curl?
Add -H "Authorization: Bearer YOUR_TOKEN" for a bearer token, or -u user:password for HTTP Basic auth. Set the Authentication section to Bearer, Basic, or API key and the correct header/flag is generated.
How do I make curl follow redirects?
Add the -L (or --location) flag, which tells curl to follow HTTP 3xx redirects to the final URL. Enable "Follow redirects" in the options.
How do I make curl ignore SSL certificate errors?
Add -k (or --insecure) to skip TLS verification. This is fine for testing against a self-signed certificate locally, but never do it in production because it defeats the security of HTTPS.
How do I upload a file with curl?
Use multipart form data: -F "file=@/path/to/file". The @ tells curl to read and upload the file. In this builder, choose the Multipart body type and set a field to "file" with the path.
How do I convert a curl command to Python or JavaScript?
Build or paste your curl command here, then switch the output tab to Python (requests) or fetch (JavaScript) to get the equivalent code. You can also paste an existing curl command into the import box to load it into the builder first.
Keep exploring
Tools and guides for your next step.