Axios Delete request with body and headers?

后端 未结 11 2118
梦谈多话
梦谈多话 2020-11-28 08:16

I\'m using Axios while programing in ReactJS and I pretend to send a DELETE request to my server.

To do so I need the headers:

headers: {
  \'Authori         


        
11条回答
  •  無奈伤痛
    2020-11-28 08:49

    i found a way that's works:

    axios
          .delete(URL, {
            params: { id: 'IDDataBase'},
            headers: {
              token: 'TOKEN',
            },
          }) 
          .then(function (response) {
            
          })
          .catch(function (error) {
            console.log(error);
          });
    

    I hope this work for you too.

提交回复
热议问题