快速测试 RESTful API.
example.api.js
const API_GET = {
url: "http://127.0.0.1:4000/users",
method: "GET",
headers: {
"Content-Type": "application/json;charset=utf-8"
}
}
const API_POST = {
url: "http://127.0.0.1:4000/users",
method: "POST",
headers: {
"Content-Type": "application/json;charset=utf-8"
}
body: JSON.stringify({
id: "123",
name: "alex",
age: 12
})
}npm run pack