cURL Command Generator
About this tool
About cURL Command Generator
cURL quoting is easy to get wrong: a single quote inside JSON, a value starting with @, or a forgotten Content-Type and the request fails in confusing ways. Fill in the form and get a ready-to-paste command. Choose the method and URL, add query parameters and headers as rows, pick Basic auth (-u) or a Bearer token, and add a JSON, URL-encoded, multipart or raw body. The generator writes the shortest correct command: it omits -X when curl would infer the method, quotes every argument safely for bash and zsh, uses --data-raw so an @ at the start of your data isn't read as a file, and switches to --form-string for multipart values that contain ; or start with @ or <. File fields become -F name=@path uploads. Tick Follow redirects for -L, or Skip TLS verification for -k when testing against a local certificate. The same request is one click away as fetch, Axios, HTTPie, Python, Go or PHP. Nothing is sent from this page.
Built and maintained by Abhi JainUpdated
How to Generate a cURL Command
- 1
Set method and URL
Choose the Method and type the URL; add Query parameters and Headers.
- 2
Add auth and body
Pick Basic or Bearer under Authorization and a Body type, then fill it in.
- 3
Copy the command
Copy the cURL command and paste it into your terminal.
cURL Command Generator: questions and answers
How do I send JSON with cURL?
curl -H 'Content-Type: application/json' --data-raw '{"key":"value"}' https://api.example.com. curl 7.82+ also has --json, which sets the Content-Type and Accept headers for you.
How do I add a bearer token to a cURL request?
Add the header -H 'Authorization: Bearer YOUR_TOKEN'. Pick Bearer token under Authorization and the generator writes it for you.
What is the difference between -d and --data-raw?
-d treats a value starting with @ as a file to read; --data-raw sends it literally. Both send a POST with the data as the body.
How do I upload a file with cURL?
Use multipart: -F 'file=@/path/to/photo.jpg'. Choose Multipart, add a field and tick File.
More HTTP Request Code Generator presets
Related tools
- cURL ConverterTurn a cURL command into fetch, Axios, Python, Go, PHP, Node or HTTPie code.
- Query String BuilderTurn key/value rows into an encoded query string and back again.
- HTTP Headers ReferenceSearchable reference of HTTP request and response headers with examples.
- JSON FormatterBeautify, minify and validate JSON with exact error locations, without changing a single value.