POST Request in Postman

  • Estimate Completion Time
    not found 30 minutes
  • Difficulty Level:

Using the given endpoint, add a new request in Postman to send the request to the server to create a new record.

Solution

Create a new request and choose the POST method to send the data with your request.

Enter the given URL.

In the request-body section, choose a raw option. From the drop-down section to the right, choose JSON and paste the data given below.

{
            "title": "Camera",
            "description": "A high-quality camera",
            "price": 7500,
            "discountPercentage": 15,
            "rating": 5,
            "stock": 90,
            "brand": "cannon",
            "category": "cameras",
            "thumbnail":"https://i.dummyjson.com/data/products/1/thumbnail.jpg",
            "images": [
                "https://i.dummyjson.com/data/products/1/1.jpg",
                "https://i.dummyjson.com/data/products/1/2.jpg",
                "https://i.dummyjson.com/data/products/1/3.jpg",
                "https://i.dummyjson.com/data/products/1/4.jpg",
                "https://i.dummyjson.com/data/products/1/thumbnail.jpg"
            ]
        }

Save the request and click on the send button to validate the response.

A new record has been created. Here, adding a new product will not add it to the server. It will simulate a POST request and return the newly created product with a new ID. In the scenario, you can check the new record added using the GET request performed in Exercise 1

Postman Practice Exercises - QA Ads Banner

Proleed Academy

Proleed serves / offers professionally designed IT training courses
globally.

Copyright © 2023 - Proleed Academy | All Rights Reserved.