cURL Builder
What is a Curl Builder?
cURL is the standard command-line tool for making HTTP requests, available on Linux, macOS and Windows 10 and later. Its flags are powerful but easy to get wrong, especially quoting JSON bodies and headers. This builder assembles a correct command from a form, so you can test an API, share a reproducible request in a bug report or paste it into a script.
How to use it
- Choose the HTTP method and enter the URL.
- Add headers such as
AuthorizationandContent-Type. - Add a JSON or raw body for POST, PUT or PATCH.
- Copy the generated command.
Example
curl -X POST 'https://api.example.com/v1/users' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{"name":"Asha","role":"admin"}'Useful cURL flags
-Xsets the method;-Hadds a header;-dsends a body.-ishows response headers;-vshows the full request and response for debugging.-Lfollows redirects.-ssilences the progress bar;-o filesaves the output.--failmakes cURL exit with an error on HTTP 4xx and 5xx, which is useful in scripts.
Quoting on different shells
The single quotes above work in bash and zsh. In Windows PowerShell, curl may be an alias for Invoke-WebRequest; call curl.exe explicitly. In Windows cmd, wrap the body in double quotes and escape inner double quotes with a backslash.
Never share commands that contain real tokens; replace them with placeholders first.
Frequently Asked Questions
How do I send JSON with cURL?
Use -X POST, add the header Content-Type: application/json and pass the JSON body with -d.
How do I see response headers with cURL?
Add -i to include headers in the output, or -v for full request and response details.
Why does curl behave differently in PowerShell?
In older PowerShell versions curl is an alias for Invoke-WebRequest. Use curl.exe to run the real cURL.
How do I follow redirects?
Add the -L flag.