question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Axios does not use data from config when making DELETE request

See original GitHub issue

Describe the bug

Axios last version (0.20.0) does not use data from config when making DELETE request. In 0.19.2 it’s working fine

To Reproduce

axios.delete("...", { 
    data: { ids: [...] },
}).then(response => {
    ...
}).catch(error => {
    ...
});

Expected behavior

Axios send request data from config when making DELETE request

Environment

  • Axios Version 0.20.0
  • Browser Chrome
  • Browser Version 84.0.4147.125
  • Node.js Version 12.18.3
  • OS: Linux Mint
  • Additional Library Versions React 16.13.1

Additional context/Screenshots

None

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:71
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

21reactions
ggaabecommented, Aug 27, 2020

I’m getting this same issue. It took a long time to figure out it was an issue with the package, this is probably a relatively urgent fix.

20reactions
tim-fieldcommented, Sep 8, 2020

FYI the following is a work around until this is fixed

axios.request({
      ...config,
      method: 'delete',
      url,
      data
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

Axios delete request is not taking the body data - Stack Overflow
Axios expects only one config object in delete request. (See here: https://github.com/axios/axios#axiosdeleteurl-config) The config is expected ...
Read more >
Axios Cheat Sheet - Kapeli - Dash for macOS
Make a request for a user with a given ID axios.get('/user?ID=12345') .then(function (response) { console.log(response); }) .catch(function (error) ...
Read more >
axios - npm
Request Config. These are the available config options for making requests. Only the url is required. Requests will default to GET if method...
Read more >
Axios API | Axios Docs
Requests can be made by passing the relevant config to axios . ... When using the alias methods url , method , and...
Read more >
ReactJS Axios GET, POST, PUT and DELETE Example Tutorial
As we know, React is a JavaScript-based library that does not have the ability to make HTTP requests; thus, we need to use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found