Why doesnt nuxt support http delete method for $fetch ?
I have this code but it causes syntax error
3 Replies
Hi @o.m. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I apologize, but there seems to be a misunderstanding in your question. Nuxt does support the HTTP DELETE method for
$fetch
. The code you provided should work correctly and does not cause a syntax error by itself.
According to the Nuxt documentation on $fetch (https://nuxt.com/docs/api/utils/dollarfetch), $fetch
supports all HTTP methods, including DELETE. Here's an example from the documentation that shows a POST request, but the same structure applies for DELETE:
Your code for a DELETE request looks correct:
If you're experiencing a syntax error, it's likely due to something else in your code or environment, not because of Nuxt's lack of support for the DELETE method.
If you're still encountering issues, you might want to:
1. Check the context where this code is being used. Make sure it's within an async function or properly handled with .then()
.
2. Verify that your Nuxt version is up to date.
3. Check for any other syntax errors in the surrounding code.
If the problem persists, you may want to provide more context about the error you're seeing and where exactly in your code this is happening.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@674984670156423171> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Does anyone have a clue with this?