Loading…
Paste a curl command and instantly convert it into equivalent JavaScript fetch, axios, Python requests, Go net/http, or Node.js http code, generated live in your browser.
fetch("https://api.example.com/v1/users", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
},
body: "{\"name\":\"Ada Lovelace\",\"email\":\"ada@example.com\"}",
})
.then((res) => res.json())
.then((data) => console.log(data))
.catch((err) => console.error(err));