AppHelp
curl 转 Axios
在浏览器本地把 cURL 命令转换成 Axios 请求代码。
POSThttps://api.example.com/orders
Code
import axios from "axios";
const response = await axios({
url: "https://api.example.com/orders",
method: "post",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer TOKEN"
},
data: "{\"sku\":\"A100\",\"qty\":2}"
});功能特点
- move API calls into apps
- create Axios examples
- debug request headers
常见问题
- 数据会上传到服务器吗?
- 不会。此工具的处理逻辑在浏览器本地运行。
- 是否需要账号?
- 不需要账号即可使用。