Developer Utilities
cURL Command Generator
Build curl commands without memorising flags. Choose the HTTP method, add a URL, headers, a Bearer token or API key and a JSON body, and this curl command generator outputs a correctly escaped command you can paste into your terminal.
Loading Utility…
Curl Generator Guide · 9 min read
Free Online cURL Builder — Generate & Test cURL Commands Without Memorizing Flags
Why Use an Online cURL Builder?
Writing cURL by hand is fast once you know the flags — but escaping JSON bodies, quoting headers with spaces, and chaining flags in the right order creates friction that slows down API debugging. A visual cURL builder removes that friction:
- No escaping errors — the builder handles quoting, JSON escaping, and special characters automatically
- No flag lookup — select Bearer, API key, or Basic Auth from a dropdown instead of looking up
-H "Authorization: Bearer ..."syntax each time - Shareable output — paste the generated command directly into a bug report, Slack message, or documentation without worrying whether the syntax is correct
- Readable for teammates — developers who aren't fluent in cURL flags can read a well-formatted generated command and understand the full request at a glance
An online cURL builder is not a replacement for learning cURL — it's a productivity tool for the parts of cURL that don't require expertise, so you can focus on the API logic instead of the command syntax.
How to Test a URL with cURL Online
Testing a URL with cURL — checking if it responds, what status code it returns, how long it takes — is one of the most common uses. The fastest approach with our builder:
- Enter the URL in the endpoint field
- Leave method as GET (the default)
- Add any required headers (e.g.
Authorization: Bearer your-token) - Click generate — copy the command and run it in any terminal
To see response headers and timing alongside the body, add -i (include headers) and -w "\nTime: %{time_total}s" to the generated command. The builder includes a verbose mode that adds -v for full request/response inspection including TLS handshake details.
For URLs that require no auth, the generated command is as simple as curl https://api.example.com/endpoint — copy, paste, done.
cURL Basics — What It Does
cURL (Client URL) is a command-line tool that transfers data to/from servers using URLs. It supports HTTP, HTTPS, FTP, SMTP, and dozens of other protocols. For API development, it's the lowest-level way to make HTTP requests — no SDK, no Postman, no abstraction layer between you and the raw request/response.
# Simplest GET request
curl https://api.example.com/users
# With verbose output (shows headers, TLS, timing)
curl -v https://api.example.com/users
# Save response to file
curl -o response.json https://api.example.com/users
The Most Useful Flags
| Flag | Long form | What it does |
|---|---|---|
-X |
--request |
HTTP method (GET, POST, PUT, DELETE, PATCH) |
-H |
--header |
Add a request header |
-d |
--data |
Request body (implies POST) |
-G |
--get |
Force GET, append -d as query string |
-o |
--output |
Save response to file |
-i |
--include |
Include response headers in output |
-I |
--head |
Fetch headers only (HEAD request) |
-v |
--verbose |
Show everything — headers, TLS, timing |
-s |
--silent |
No progress meter or errors |
-w |
--write-out |
Print specific info after completion |
-L |
--location |
Follow redirects |
-k |
--insecure |
Skip TLS certificate verification |
-u |
--user |
Basic auth credentials user:password |
--max-time |
— | Total time limit in seconds |
--connect-timeout |
— | Connection timeout in seconds |
Authentication Patterns
Bearer token (JWT, OAuth2)
curl -X GET "https://api.example.com/users/me" \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9..." \
-H "Accept: application/json"
API key in header
curl -X GET "https://api.example.com/data" \
-H "X-API-Key: your-api-key-here" \
-H "Content-Type: application/json"
Basic Authentication
# Let cURL encode the credentials
curl -u "username:password" https://api.example.com/resource
# Or set the header manually (Base64 of "username:password")
curl -H "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=" \
https://api.example.com/resource
Use our Base64 Encoder to generate the value for manual Basic Auth headers. For generating strong API keys and secrets, use our Password Generator.
HMAC webhook signature
# Compute signature and include in header
SIGNATURE=$(echo -n "$PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET" | sed 's/.* //')
curl -X POST "https://your-webhook-endpoint.com/events" \
-H "Content-Type: application/json" \
-H "X-Signature-256: sha256=$SIGNATURE" \
-d "$PAYLOAD"
Test webhook signature validation — our Webhook Signature Verifier guide covers HMAC debugging for Stripe, GitHub, Shopify, and Slack.
Sending Request Bodies
JSON body (most common)
curl -X POST "https://api.example.com/users" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-token" \
-d '{
"name": "Jane Doe",
"email": "jane@example.com",
"role": "admin"
}'
Always set Content-Type: application/json when sending JSON — without it, many APIs reject the body or misparse it. Format and validate your JSON payload first with our JSON Formatter before embedding in the cURL command.
Form data
curl -X POST "https://api.example.com/upload" \
-F "file=@/path/to/file.pdf" \
-F "title=My Document" \
-H "Authorization: Bearer your-token"
URL-encoded form
curl -X POST "https://api.example.com/auth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=abc&client_secret=xyz"
Use our URL Encoder to properly encode any special characters in form values before embedding them.
Inspecting Response Details
Check HTTP status code only
curl -s -o /dev/null -w "%{http_code}" https://api.example.com/users
Response headers and timing
curl -s -o /dev/null -w "Status: %{http_code}\nTime: %{time_total}s\nSize: %{size_download} bytes\n" \
https://api.example.com/users
Follow redirects and show final URL
curl -L -w "Final URL: %{url_effective}\n" https://api.example.com/redirect
Reference our HTTP Status Code guide when interpreting response codes — knowing the difference between 401 vs 403 or 422 vs 400 changes how you debug.
Debugging TLS Issues
# Show TLS certificate details
curl -v --head https://api.example.com 2>&1 | grep -A 20 "Server certificate"
# Use specific TLS version
curl --tlsv1.2 https://api.example.com
# Skip verification (only in dev, never production)
curl -k https://localhost:8443/api/test
The -v (verbose) flag shows the full TLS handshake — certificate chain, cipher suite, and protocol version. This is indispensable when debugging MTLS or certificate pinning issues.
Multi-step Flows with Session Cookies
# Step 1: Login and save cookies
curl -X POST "https://app.example.com/auth/login" \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","password":"secret"}' \
-c cookies.txt
# Step 2: Use saved cookies for authenticated request
curl -X GET "https://app.example.com/dashboard" \
-b cookies.txt
The -c flag saves cookies to a file; -b loads them. This simulates a full browser session for testing cookie-based authentication.
Building Reproducible Bug Reports
A cURL command is the gold standard for reporting API bugs — it removes all ambiguity about what was sent:
# Complete, reproducible bug report command
curl -X POST "https://api.example.com/orders" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-H "X-Request-ID: $(uuidgen)" \
-d '{"productId": "prod_123", "quantity": 0}' \
-w "\nStatus: %{http_code}" \
-s
Before sharing: scrub real tokens from the command and replace with $TOKEN or a dummy value. Use our PII Redactor to sanitize any embedded user data in request bodies. Document the failing request alongside expected vs actual behavior in our Markdown Editor for clean issue reports.
Generating UUIDs for Request Tracing
Many APIs benefit from a unique X-Request-ID or X-Trace-ID header for correlating requests across distributed logs:
curl -X POST "https://api.example.com/orders" \
-H "X-Request-ID: $(uuidgen)" \
...
Use our UUID Generator for consistent UUID v4 generation when building test suites or scripting batch API calls.
Frequently Asked Questions
Everything you need to know about the Curl Generator and how your data is handled.
- What is cURL and why do developers use it?
- cURL (Client URL) is a command-line tool for making HTTP requests — sending GET, POST, PUT, DELETE, and other HTTP method requests to URLs from a terminal. Developers use it to test REST APIs without a GUI client, reproduce bugs with an exact reproducible request, script authentication flows, verify SSL certificates, and share runnable API examples in documentation. It's available on Linux, macOS, and Windows and is the universal language for describing an HTTP request in text form.
- How do I send a POST request with JSON body using cURL?
- Use -X POST to set the method, -H "Content-Type: application/json" to set the content type header, and -d '{"key":"value"}' for the JSON body. A full example: curl -X POST https://api.example.com/users -H "Content-Type: application/json" -d '{"name":"Alice","email":"alice@example.com"}'. The cURL Generator builds this command from form inputs, handling quoting and escaping automatically so special characters in the JSON body do not break the shell command.
- How do I add authentication headers to a cURL request?
- For Bearer token authentication, add -H "Authorization: Bearer YOUR_TOKEN". For HTTP Basic Auth, use --user username:password (cURL encodes it automatically) or -H "Authorization: Basic BASE64_ENCODED_CREDENTIALS". For API key headers, add the key with whatever header name the API requires: -H "X-API-Key: your-key-here". For OAuth 2.0, obtain a token separately and add it as a Bearer header on subsequent requests.
- How do I follow redirects and handle SSL issues with cURL?
- Add -L to follow HTTP redirects automatically (cURL does not follow them by default). For SSL certificate issues in development environments, -k or --insecure bypasses certificate verification — never use this in production or with real credentials as it disables security. To specify a custom CA certificate, use --cacert /path/to/ca.pem. To see the full request and response headers for debugging, add -v (verbose) to any cURL command.
Common Use Cases
- API Debugging
- CLI Testing
- Documentation Reproduction
Related Tools
Dockerfile Generator
Generate production-ready Dockerfiles visually with step-by-step guidance.
Cron Generator
Build, validate, and explain Cron expressions visually with human-readable translation.
SQL Query Generator
Build complex SQL queries visually with support for multiple dialects.
Base64 Encoder
Encode binary or text data to Base64 format locally.
Base64 Decoder
Decode Base64 strings back to human-readable format locally.
URL Encoder/Decoder
Encode/decode URL components to handle special characters safely.