Next.js Discord

Discord Forum

Can not get the request data from route.js

Answered
Persian posted this in #help-forum
Open in Discord
PersianOP
Hi i created a route to create data in the db and worked perfectly but when created a one to delete it in the same route.js folder but with DELETE method i'm getting this error
Answered by riský
I already helped you here: https://nextjs-forum.com/post/1158508765474209924#message-1158509063328497775... but the answer was that you can't send a body with DELETE requests and instead must rely on url params (including dynamic routes)
View full answer

5 Replies

PersianOP
This is how i send data
The db create function in the route.ts
The delete method
and when im logging The err in the catch im getting this error
I already helped you here: https://nextjs-forum.com/post/1158508765474209924#message-1158509063328497775... but the answer was that you can't send a body with DELETE requests and instead must rely on url params (including dynamic routes)
Answer