Bibooo0
2021-08-02 12:06
采纳率: 66.7%
浏览 154
已结题

axios.delete请求错误

img

node.js
img

报错
img

我看网上有很多这种报错
// url 参数传递, DELETE /api/book/12?keep_file=[keepFile]
function deleteById(id, keepFile) {
Axios.delete(/api/book/${id}, {params: {keep_file: keepFile}}).then(res => {console.log("Delete Successfully"), err => {console.log("Delete Failed")}})

// 通过body 传参, DELETE /api/book/12, request payload: {keep_file: keepFile}
function deleteById(id, keepFile) {
Axios.delete(/api/book/${id}, {data: {keep_file: keepFile}}).then(res => {console.log("Delete Successfully"), err => {console.log("Delete Failed")}})
}
不知道怎么解决

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题