curl Command Generator
Specify the HTTP method, URL, headers, body, and authentication method in the form to generate a ready-to-run curl command you can copy and paste. No request is actually sent, so CORS restrictions never apply.
Common curl Options
| Option | Description |
|---|---|
| -X, --request <method> | Specifies the HTTP method (GET, POST, PUT, PATCH, DELETE, etc.). If omitted, it defaults to GET when there is no body, or POST when there is a body. |
| -H, --header <header> | Adds a single request header. Repeat -H to add multiple headers. |
| -d, --data <data> | Sends a request body. If -X is not specified, it is automatically sent as POST with Content-Type: application/x-www-form-urlencoded. |
| -u, --user <user:password> | Specifies the username and password for Basic authentication in "user:password" format. |
| -k, --insecure | Skips SSL certificate verification. Intended for development environments with self-signed certificates. Not recommended in production. |
| -L, --location | Automatically follows the destination indicated by the Location header when the server returns a 3xx redirect. |
| -v, --verbose | Prints detailed request and response exchanges, including headers, to standard error. Useful for debugging. |
| --compressed | Adds an Accept-Encoding header, requesting and automatically decompressing responses compressed with gzip and similar encodings. |
| -o, --output <file> | Saves the response body to the specified file instead of standard output. |
| -F, --form <name=content> | Sends form data or files as multipart/form-data. Specify "@filepath" for file uploads. |
Tips
- The generated command can be pasted directly into a terminal, shell script, or CI/CD config file and run as-is. All values are already escaped with single quotes.
- A warning appears if you enter a body while the method is still GET. This is because curl automatically sends the request as POST when
-dis used without-X, so the warning helps you avoid unintended behavior. - Checking "Automatically add Content-Type: application/json" adds the Content-Type header that is easy to forget when calling a JSON API.
- Both Basic auth and Bearer token values are processed entirely inside your browser and are never sent to any server.
- The generated
-k(skip certificate verification) is a temporary workaround meant only for local development with self-signed certificates. Avoid using it permanently against production APIs.
Frequently Asked Questions
-d (body data) without the -X option, it automatically sends the request as POST. For the rare case where you need to keep GET while sending a body, manually add -X GET to the generated command.
Side Note — Why curl Is the Tool Everyone Uses but Almost No One Knows
curl is a command-line tool for transferring data with URLs, created in 1996 by Swedish engineer Daniel Stenberg. It originated from a small script that fetched currency exchange rates for an IRC chat bot, and has since grown into a massive project supporting more than 25 protocols, including HTTP, FTP, and SMTP.
curl is considered one of the most widely used pieces of software in the world. It is embedded inside virtually every internet-connected device — smartphones, cars, home appliances, game consoles, and even spacecraft (it has been used in NASA Mars missions) — with an estimated installed base in the tens of billions. Despite this ubiquity, it remains a classic example of unsung infrastructure that almost no one outside of developers has heard of.
In 2019, Stenberg was honored by the Linux Foundation for his contributions to foundational web technology. He remains the central maintainer driving curl development today, known for carefully preserving backward compatibility over more than two decades.
Even now that GUI tools like Postman are widespread, curl commands are still used in READMEs, official documentation, and API verification steps. The reason is simple: curl requires no installation and comes preinstalled on nearly every Linux and macOS environment, letting anyone run a single command on the spot and share the result — a level of reproducibility that is hard to beat.