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 not supported?

See original GitHub issue

Hi

I keep getting “DELETE http://localhost:54690/api/Storage/Delete 415 (Unsupported Media Type)” when I try to use axios delete.

export const axiosInstant = axios.create({
  baseURL: 'http://localhost:54690/api',
  timeout: 10000,
  headers: { 'Content-Type': 'application/json' }
});

export function deleteSelectedStorage(storage) {
    return function (dispatch) {
        return axiosInstant.delete('/Storage/Delete', { storage: storage}).then(function () {
            dispatch({
                type: actions.SELECTED_STORAGE_DELETED,
                payload: {
                    selectedStorage: storage
                }
            });
        });
    }
}


am I doing something wrong?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
nickuraltsevcommented, Aug 22, 2016

I think I know what’s going on. You are trying to make a request with a body using axios#delete which does not accept request body as a parameter. Please try to use request method instead:

instance.request({
  url: '/Storage/Delete',
  method: 'delete',
  data: { storage: storage }
});
0reactions
8bitjoeycommented, Mar 15, 2017

So @chobo2 can basically use:

axios.delete(url, { data: {storage: storage}})

right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring - 405 Http method DELETE is not supported by this URL
This will work: @RequestMapping(value = "/{authorizationUrl}", method = DELETE) @ResponseBody public void deleteAuthorizationServer( ...
Read more >
The DELETE method is not supported spring boot
using Angular 8 and Springboot app… passing value through JSON getting error: Request delete doesn't supported here is the error :.
Read more >
The DELETE method is not supported for this route - Laracasts
I get this error whenever I hit the delete button to delete a thread. The DELETE method is not supported for this route....
Read more >
The DELETE method is not supported for this route In Laravel ...
The DELETE method is not supported for this route In Laravel 8 Solution. 1.1K views 1 year ago MATHURA · Programming Experience.
Read more >
Method delete is not supported #497 - inertiajs/inertia - GitHub
Instead, what I'm assuming is happening, is that you're using the DELETE method to an endpoint/URL that, as the message is already informing...
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