cURL Command Builder
Build curl commands interactively — select method, add headers, set auth, and copy the result
- Home
- /
- cURL Builder
Request
Options
Generated cURL Command
curl --request GET \
--url https://api.example.com/data \
--header 'Accept: application/json'
Method
GET
Headers
0
Flags
0
What Is cURL?
cURL (Client URL) is a command-line tool and library for transferring data with URLs. It supports a wide range of protocols including HTTP, HTTPS, FTP, SFTP, and many more. cURL is built into most operating systems and is an essential tool for developers, system administrators, and anyone who needs to interact with APIs or web services from the command line.
With over 200 command-line options, cURL can handle virtually any data transfer scenario. This builder helps you construct the most common HTTP request patterns without memorizing all the flags.
How to Use This Builder
- Select the HTTP method — Choose GET, POST, PUT, PATCH, DELETE, HEAD, or OPTIONS.
- Enter the URL — Paste the full URL including protocol (https://).
- Add query parameters — Use the key-value pairs to build query string parameters.
- Set headers — Add custom headers like Authorization, Content-Type, or Accept.
- Provide a body — For POST, PUT, and PATCH methods, enter the request body and select the Content-Type.
- Configure authentication — Choose Basic Auth or Bearer Token if needed.
- Toggle options — Enable follow redirects, verbose mode, or other cURL flags.
- Copy the command — Click the Copy button to copy the generated curl command to your clipboard.
Common cURL Examples
GET request with headers
curl --request GET \
--url 'https://api.github.com/repos/curl/curl' \
--header 'Accept: application/vnd.github+json' \
--header 'User-Agent: MyApp'
POST with JSON body and Bearer auth
curl --request POST \
--url https://api.example.com/users \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIs...' \
--header 'Content-Type: application/json' \
--data '{"name":"John","email":"john@example.com"}'
Upload file with form data
curl --request POST \
--url https://api.example.com/upload \
--form 'file=@/path/to/document.pdf' \
--form 'description=Monthly report'
FAQs
Is cURL installed on my system?
cURL comes pre-installed on macOS and most Linux distributions. Windows 10+ includes curl.exe in the command prompt. You can check by running curl --version in your terminal.
What is the difference between -X, --request, and --data?
-X or --request specifies the HTTP method. --data sends data in the request body (typically for POST). cURL automatically switches to POST when you use --data even without specifying -X POST.
How do I debug a curl command?
Add -v or --verbose to see request headers, response headers, and connection details. For even more detail, use --trace or --trace-ascii to see the raw bytes being sent and received.
Can I use curl with GraphQL?
Yes. Send a POST request with Content-Type: application/json and a JSON body containing {"query": "..."}. Many GraphQL APIs also accept Accept: application/json.