Nextjs send data to the api route #15857
Unanswered
Prottoy2938
asked this question in
Help
Replies: 2 comments 1 reply
-
Can you check the chrome network tab? Potentially there's a CORS |
Beta Was this translation helpful? Give feedback.
0 replies
-
I found out the bug, I was developing the application from vscode codespaces, where it runs on the remote server from azure. The problem was occurring only there. I need to furthermore debug on this. The application works as expected on my local machine. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I can't send any data using a post request in
nextjs
. In the API route, I receive the request and can send a response back...but I couldn't receive the data that I've sent from the client. So, myreq.body
shows an empty object:{ }
Heres how I'm sending data from the client using
axios
:And here's how I'm handling the data on
/api/hello
route:Beta Was this translation helpful? Give feedback.
All reactions