#Custom express route body is empty
9 messages · Page 1 of 1 (latest)
I'm doing a get request to /test. The request is being received correctly, but when I try to extract parameters from the Body, I get nothing
are you sending anything in the body?
Yes, I'm sending a json in the body. And the response is being received. I set that route in server.ts
do you have an app.use(express.json()); somewhere in your server.ts?
i would also try changing it to app.post to receive a req.body
personally my get routes usually use URL/query params as opposed to a req body
That worked!! Thanks 😄
nice one!