Guide: How to make POST request in POSTMAN
- Make request POST
- take the same route like for getAll, in our example http://localhost:5555/api/v1/products
- go to "Body" tab & select "raw" option
- change from 'text' to "JSON" format
-
make necessary object
{}"name": "Samsung","price": 2700OR in case when product collection connected (bound) with category collection{}"name": "Samsung","price": 2700,"category": "645b40cd4aaa8cdfd52bc245"
Make sure that in POSTMAN keys (name, price etc.) made in ""
-
A) Request for file sending (ONLY FILE)
- Create POST request to "http://localhost:5555/file"
- Go to "body" tab
- Choose "form-data"
- In key filed add special filed > avatar > & in the same filed on right side choose from dropdown menu > file >
- In Value filed take an image file
- Add file like in A)
- Set request field "Content-Type" possibility
- Type in "Content Type" filed application/json
- P.S. learn more from video