In this post, we are going to see Step By Step Tutorial for sending Post Request from PostMan to SpringBoot, for Beginners and Developers.
Step 1: Open PostMan
Step 2: Click on New

Step 3: Select HTTP in the popup.

Step 4: Select POST before the URL

Step 5: Give the PostMapping URL (Enter the endpoint URL) from your Springboot Application: Eg. http://localhost:8080/api/products
Step 6: Set Request Body
- Go to the Body tab.
- Select raw.
- Choose JSON from the drop down.

Enter the JSON data like below. (based on your Entity class fields in SpringBoot)
{
"name": "Product 1",
"description": "This is a test product",
"price": 10000,
"rating": 4,
"stock": 5,
"img": "image-url"
}
Step 7: Set Headers
- Go to the Headers tab.
- Add the following header:
- Key: Content-Type
- Value: application/json

Step 8: Send Request
Click Send.
Step 9: You will get Status:200 OK, if the request is Successful.

Step 10: Verify in Database:
You can verify if the data is saved in the database using a SELECT
query:
SELECT * FROM products;
Step 11: On the other side, you can verify through GET Request through PostMan.
