#Custom express route body is empty

9 messages · Page 1 of 1 (latest)

nocturne olive
#

Does anybody know why req.body is empty in my custom express route?

#

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

uncut jewel
#

are you sending anything in the body?

nocturne olive
#

Yes, I'm sending a json in the body. And the response is being received. I set that route in server.ts

uncut jewel
#

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

nocturne olive
uncut jewel
#

nice one!