Post request does not have req.body

Hi, I added a url:'/access_token', function(req, res) {}

My curl post is:

curl -X POST \
-H "X-Parse-Application-Id: cn67FArPjbz46E6CprmZsbCXvo2PDRDgcneRoyp3" \
-H "Content-Type: application/json" \
-d '{"uid":2882341273,"channelName":"7d72365eb983485397e3e3f9d460bdda"}' \

However, the received post request does not have body when I tried to use req.body.
Is this because this sentence in ParseServer.js
api.use(express.json({ type: '*/*', limit: maxUploadSize })); ?
What does type: */* mean here?


You should use bodyparser to access request body.


Add this before your custom route.

Edit: seems like you added route under parse endpoint. Make sure api.use(express.json()) is before your route.

@uzaysan Thanks. My api.use(express.json()) came before the'/access_token', function(req, res) {}. That is why.