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.

`delete` doesn't support payload nor query params

See original GitHub issue

Axios doesn’t seem to support adding payloads and/or query params to delete. Note, I’m referring to using the config object instead of the convenience delete method. In particular, the following does not work, in chrome devtools the request is poorly formed:

axios(R.merge({
      method: 'delete',
      url: `/entities/someId`,
      data: payload,
      params: {
        force: true,
      }
    }, axios.config))

Any reason why this should be so?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
nickuraltsevcommented, May 3, 2016

You should not merge your config with axios.config when making a request. Could you please try to use the following?

axios({
  method: 'delete',
  url: `/entities/someId`,
  data: payload,
  params: {
    force: true
  }
})
0reactions
nickuraltsevcommented, May 3, 2016

You are welcome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is an entity body allowed for an HTTP DELETE request?
A payload within a DELETE request message has no defined semantics; sending a payload body on a DELETE request might cause some existing ......
Read more >
HTTP Delete Rest service with request body as payload
It is common practice to qualify HTTP DELETE requests by including query parameters in the URL. While it is not explicitly forbidden to...
Read more >
REST - Should you use a body for your HTTP DELETE ...
A payload within a DELETE request message has no defined semantics; sending a payload body on a DELETE request might cause some existing ......
Read more >
Remove queryparam after assign message to payload
Hello Apigeeks Payload {"bookid":"{request.queryparam.bookid}"} true Above, I set json payload from the queryparam and removed.
Read more >
Does REST API Supports Request Body for DELETE Method
We don't support the Request body with the DELETE method. It does allow you to pass HTTP Query Parameters. The world works with...
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