axios(2)——axios的request方法,post方法
axios的request方法axios.request({method: "GET",url: "http://localhost:3000/comments",}).then((response) => {console.log(response);});axios的post方法axios.post("http://localhost:3000/comments", {body: "今天
·
axios的request方法
axios
.request({
method: "GET",
url: "http://localhost:3000/comments",
})
.then((response) => {
console.log(response);
});
axios的post方法
axios
.post("http://localhost:3000/comments", {
body: "今天天气真不错",
postId: "张三",
})
.then((response) => {
console.log(response);
});
更多axios封装的发送请求方法可参考:axios使用说明
更多推荐
已为社区贡献7条内容
所有评论(0)