cURL Converter — cURL to fetch, Python, Go, PHP
Convert cURL commands to JavaScript fetch, Node, Python requests, Go, PHP and axios. See method, query, headers, cookies and body parsed. Runs in your browser.
cURL command
Request
POSThttps://api.example.com/v1/orders
Query parameters
2
- expand
- items
- limit
- 20
Headers
2
- Content-Type
- application/json
- Authorization
- Bearer demo_7f3a9c2e41
Cookies
2
- session
- 7d1f0c
- theme
- dark
Body
JSON
{
"customer": "cus_42",
"items": [
{
"sku": "KB-75",
"qty": 1
}
],
"note": "It's a gift"
}Options
Compressed (--compressed)
// Browsers drop forbidden headers (Cookie, Host, Referer…).
// For cookies, use credentials: "include" instead.
// Browser manual redirects return an opaque response; the 3xx status and body are unavailable.
const response = await fetch("https://api.example.com/v1/orders?expand=items&limit=20", {
redirect: "manual",
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer demo_7f3a9c2e41",
"Cookie": "session=7d1f0c; theme=dark"
},
body: JSON.stringify({
"customer": "cus_42",
"items": [
{
"sku": "KB-75",
"qty": 1
}
],
"note": "It's a gift"
})
});
console.log(response.status, await response.text());POST · 25 lines · warnings: 0Nothing is sent
Runs in your browser. The command is parsed, never executed, and no request is made.
Related tools
Format references
Tool page updated: