Axios Delete request with body and headers in ReactJS

You can make http delete request using axios in React JS. First you have to import axios package using npm with npm install axios command after that you hit a HTTP request using it.

Answers 1
  • Delete request in node using axios package

    axios.delete(API_URL, {
      headers: {
        Authorization: authorizationToken
      },
      data: {
        user_id: 32
      }
    });
    
    -1

    You have to add the URL, headers with authorization token and data with data in axios to make a HTTP request.  To use axios you have to import axios package using npm install axios command.

  • Back to code snippet queries related nodejs