AppHelp
curl 转 fetch
在浏览器本地把 cURL 命令转换成 JavaScript fetch 代码。
POSThttps://api.example.com/orders
Code
const response = await fetch("https://api.example.com/orders", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer TOKEN"
},
body: "{\"sku\":\"A100\",\"qty\":2}",
});
const data = await response.text();功能特點
- port API examples
- debug frontend requests
- share fetch snippets
常見問題
- 数据会上传到服务器吗?
- 不会。此工具的处理逻辑在浏览器本地运行。
- 是否需要账号?
- 不需要账号即可使用。