#express js#api#node#node js#web services

How to get post data in json in express JS APIs - Node JS

Saturday, Oct 22, 2022

Thought it sounds simple and straight forward, this thing killed a lot of my time at the initial time of getting into node JS.

the query string are directly available in the request for both get and post methods but to get the post data you send in json format you need to update you express JS index.js . In the root of your express JS setup you have index.js add the following line on the top after the creation of app.


Now you will be able to access the json data in post request in req.body

If you are facing the same issue with your form submits, please follow the link for the solution.