RustPoint 工具集合

cURL 转 fetch / axios

把常见 cURL 命令转换成 fetch 和 axios 请求代码。

返回工具集合
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\"}"
});