Closed mariusa closed 2 years ago
Could you add a Minimal, Reproducible Example?
Looking at the code provided, it should work
Sure: https://github.com/mariusa/fastify-rawbody-bug
Also tried with global: true
GET http://localhost:5000/api/monitor
req.body is null (correct for GET), but req.rawBody is undefined
curl -k -X POST -H "Content-Type: application/json" http://localhost:5000/api/test -d '{"title": "blouse"}'
Move the raw-body plugin registration before autoload, there should be some conflicts between them
Thank you, that was it!
Hi,
Trying to get
req.rawBody
set in fastify route handlers, besides the regularreq.body
JSON objectand later
I've tried many variations on this, it's always undefined. Found another comment saying it doesn't work too https://github.com/fastify/fastify/issues/707#issuecomment-817224931
What's wrong, please?