Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

axios delete request

import axios from "axios";
/// DELETE REQUEST

handleDeleteById(id).then((res) => {
      alert("deleted")
});

function handleDeleteById(id) {
  // console.log(data);
  // {name: "mysore", population: 11111, country: "India"}
  return axios({
    baseURL: "baseURL",
    url: `/${id}`,
    method: "DELETE"
  });
}
Source by github.com #
 
PREVIOUS NEXT
Tagged: #axios #delete #request
ADD COMMENT
Topic
Name
7+8 =