How Should I Format My Post Data For Testing An Express Api Endpoint?
I am following: https://www.digitalocean.com/community/tutorials/getting-started-with-the-mern-stack. I would like to test an API endpoint built using express. I would like to test
Solution 1:
Open Postman, select request as POST and click on Body.
Under Body, select raw and insert your data in the space below like this and change from text to JSON option:-
{ "action":"asdf" }
Please make sure to add this to your app.js file before any route handler
const app = express(); app.use(express.json());
Post a Comment for "How Should I Format My Post Data For Testing An Express Api Endpoint?"