curl Command Builder and Converter
Build curl commands and convert them to fetch, Python and HTTPie.
About this tool
Fill in the method, URL, headers, body and auth to get a ready-to-run curl command, or paste an existing curl command to edit it. Every request is also shown as JavaScript fetch, Python requests and HTTPie. Nothing is sent: the tool only writes the commands.
How to use it
- Paste an existing curl command to import it, for example from your browser’s developer tools (Copy as cURL).
- Or set the method and URL, then add headers, auth and a JSON, form or raw body.
- Choose options like following redirects or showing response headers.
- Copy the result as curl, JavaScript fetch, Python requests or HTTPie.
Questions
- How do I send JSON with curl?
- Use -H 'Content-Type: application/json' together with --data-raw '{"key":"value"}'. Newer curl versions also have --json, which sets both the Content-Type and Accept headers for you. Choose JSON as the body type here and the right flags are added.
- Does this tool send my request?
- No. It only writes code. Nothing leaves your browser, so it is safe to paste commands that contain tokens, though it is good practice to replace real secrets with placeholders before sharing a command.
- What is the difference between -d and --data-raw?
- With -d, a value starting with @ is read from a file. --data-raw sends the text exactly as written, which is safer for JSON and for values that may start with @.
- Why does curl not follow redirects?
- By default curl shows the redirect response itself. Add -L (Follow redirects) to go to the new location. fetch and most libraries follow redirects automatically.
- Which curl options can be imported?
- Method, URL, headers, the data options, --json, -u, user agent, cookies, referer, -G, -L, -i, -s, -k, -v, --head and --compressed. Multipart -F fields and other rare options are skipped with a note.
Something not working, or a result looks wrong? Report a problem with this tool