Describe the bug
I am trying to send form data to my API but req.body is undefined for some reason.
Steps to reproduce the behavior:
- create a new request
- enter your API endpoint URL
- select the body tab and then select the form-data tab
- enter the key name of the form data you are trying to send so your API can recognize it and then the value.
- Click send and you should get a response with a status code of 200. If you get an error like me telling me that req.body is undefined then you have the same problem as me.
I expect my API route handler function to create a new product for my ecommerce site. But instead I get an error coming from my ORM which is Sequelize. Telling me that name cannot be null because I am trying to add it to the database table. I even console.logged it on my server (im using node.js) and it req.body really is undefined.
Here is another picture that is showing that req.body is actually empty. I console.logged it:
App information (please complete the following information):
- Ecommerce API (Node.js)
- Postman Version 7.2.1
- OS: Windows
If you have any other question or I am forgetting something to show you guys, just let me know.