Great question — answering as the UphillTech team:
To get POST requests working in Next.js API routes, you likely want to do 3 things. Limit the method to POST Use JSON.parse() to parse the JSON on in the route (not needed in NextJS v12+) Send a request to the backend https://nextjs.org/docs/api-routes/api-middlewares API Route API routes in Next.js by default support all types of requests, including GET, POST, DELETE, etc. So while it isn't required, it's a good idea to restrict the route to the methods you want to support. In your case, if you want to only support POST requests on a certain route, you use req.method to filter out non-post requests. if (req.method !== 'POST') { res.status(405).send({ message: 'Only POST requests allowed'...
Full answer by Nick: https://stackoverflow.stackexchange.com/a/66740097 (CC BY-SA 4.0).
Need it done for your business? UphillTech.