How do you turn a curl command into code? Paste it, pick JavaScript, Python, PHP or Go, and copy the equivalent request.
fetch("https://api.example.com/v1/users", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
body: JSON.stringify({
"name": "Ada",
"email": "ada@example.com"
}),
})
.then((response) => response.text())
.then((data) => console.log(data))
.catch((error) => console.error(error));
| Option | What it does |
|---|---|
-X, --request | HTTP method |
-H, --header | Request header (also -A user agent, -e referer, -b cookie) |
-d, --data, --data-raw, --data-binary, --json | Request body |
-u, --user | Basic authentication |
-F, --form | Multipart form fields and file uploads |
-G, --get | Send data as a query string |
-I, --head | HEAD request |
-k, --insecure | Skip TLS certificate verification |
-L, --location | Follow redirects |
--compressed | Request a compressed response |
Options not listed (such as proxies or client certificates) are ignored. Review the generated code before running it.
Your feedback helps us improve
Try combining multiple tools for a complete workflow. For example: Notepad → Text Encryption → Save to Cloud or Date Calculator → Calendar → Countdown Timer
Build HTTP requests with URL, method, headers, and body. Send or copy as cURL or fetch snippet.
Parse raw HTTP response headers online. Paste from DevTools or curl, inspect CORS and cache headers, copy any value.
Inspect JSON in an interactive tree. Expand and collapse nodes, copy paths, and view formatted JSON.
Inspect JSON in an interactive tree. Expand and collapse nodes, copy paths, and view formatted JSON.
Test JSONPath expressions against your JSON and see every match with its path. Filters, slices and recursive descent. Client-side only.
Compare two JSON documents with structural path diff and formatted line diff. Client-side only.
We'd love to hear your thoughts! Your feedback helps us improve our tools and create a better experience for everyone.
Tell us what you think about this tool