Delete Method in Axios, Laravel and VueJS

前端 未结 4 1452
忘掉有多难
忘掉有多难 2021-01-11 16:49

I am trying to send a delete request via axios to laravel as follow:

axios.delete(\'api/users/\' + this.checkedNames)
.then((response) => {
    console.log         


        
4条回答
  •  灰色年华
    2021-01-11 17:10

    I also experienced the same problem. This works for me:

    deletePost: function(id) {
                    axios.post('/posts/'+id,{_method: 'delete'})
                }
    

    Using axios.post() instead of axios.delete, and sending _method "delete"

提交回复
热议问题