cURL → Code Converter
Convert cURL commands to JavaScript, Python, Go, PHP, Ruby, Java, C#, Swift, C++, Rust and more.
Convert cURL commands to JavaScript, Python, Go, PHP, Ruby, Java, C#, Swift, C++, Rust and more.
fetch("https://api.example.com/users", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN"
},
body: "{\"name\":\"Ada\",\"role\":\"admin\"}"
})
.then((res) => res.json())
.then(console.log)