cURL Command Builder - Build and Copy cURL Commands
Developer Tools
Visually build cURL commands without memorising flags. Set the HTTP method, URL, headers, body (JSON, form, raw), and authentication, then copy the ready-to-run command.
curl \ -L \ -X GET \ 'https://api.example.com/endpoint'
How to use this tool
- Enter the HTTP method and URL.
- Add request headers and choose an authentication type.
- Select a body type and paste your request body if needed.
- Copy the generated cURL command and run it in your terminal.
cURL Command Reference
cURL is a command-line tool for making HTTP (and other protocol) requests. Common flags used
by this builder: -X sets the method, -H adds a header,
--data sets the request body, -u provides Basic credentials, and
-L follows redirects.
Most common curl recipes
| Task | Command |
|---|---|
| GET request | curl https://api.example.com/data |
| POST JSON | curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' https://api.example.com |
| POST form data | curl -X POST -d "name=Alice&age=30" https://example.com/form |
| Bearer token auth | curl -H "Authorization: Bearer TOKEN" https://api.example.com |
| Basic auth | curl -u username:password https://example.com |
| Follow redirects | curl -L https://example.com |
| Save to file | curl -o output.json https://api.example.com/data |
| Ignore SSL errors (dev only) | curl -k https://self-signed.badssl.com |
curl vs. wget
curl: Transfers data to/from a server. Supports many protocols (HTTP, FTP, SMTP). Better for APIs and single requests. Output goes to stdout by default.
wget: Downloads files from the web. Supports recursive downloads (entire websites). Automatically resumes interrupted downloads. Better for bulk file downloads. Output saves to disk by default.
Debugging tips
-
-v(verbose): Show request headers, response headers, and SSL handshake details. -
--trace/--trace-ascii: Full protocol dump (binary or ASCII). Very detailed. -I/--head: Fetch headers only, no body.-
-w(write-out): Print timing stats like total time, DNS lookup time, connect time:-w "@curl-format.txt" -
--compressed: Request and decompress gzip/deflate responses automatically.
Platform differences
Linux/Mac: Use single quotes around JSON strings to prevent shell interpretation:
curl -d '{"key":"value"}'
Windows PowerShell/cmd: Single quotes are treated as literal characters. Use double
quotes and escape inner quotes with backslashes:
curl -d "{\"key\":\"value\"}" or use @file.json to read from
a file.
Security Note
Credentials entered here never leave your browser. However, avoid sharing generated commands that contain real tokens or passwords in logs or public issue trackers.
Frequently asked questions
Is the generated command safe to run?
The command is built entirely in your browser. Always review commands before running them, especially when they contain authentication credentials.
What does --data vs --data-urlencode do?
--data sends the body as-is, while --data-urlencode percent-encodes special characters. Use --data for JSON or raw bodies; --data-urlencode for form fields.
Related tools
- HTTP Header AnalyzerUse HTTP Header Analyzer to paste HTTP response headers to get instant explanations,.
- URL ParserUse URL Parser to parse any URL into its components: protocol, hostname,.
- Query StringUse Query String to parse URL query strings into key-value tables and.
- HTTP Status CodesUse HTTP Status Codes to searchable reference for all HTTP status codes: 1xx,.