RustPoint Tools

cURL to fetch / axios

Convert common cURL commands into fetch and axios request snippets.

Back to tools
await fetch("https://api.example.com/users", {
  method: "POST",
  headers: {
  "Content-Type": "application/json",
  "Authorization": "Bearer token"
},
  body: "{\"name\":\"RustPoint\"}"
});

await axios({
  url: "https://api.example.com/users",
  method: "post",
  headers: {
  "Content-Type": "application/json",
  "Authorization": "Bearer token"
},
  data: "{\"name\":\"RustPoint\"}"
});