PUT Request in Postman

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

API Endpoint: https://jsonplaceholder.typicode.com/posts/1

Using the above endpoint to update or edit the existing record. Add a new request in Postman to send the request to the server to edit the information of a record.

Solution

Create a new request and first choose the GET method to ensure the record already exists. Save the request and click on the send button to check the response.

Now choose the PUT method to send the data with your request.

In the PUT method, we need to send the whole resource along with the parameters that need to be updated.

Even if you want to update the title only, you need to send all the parameters along with the title to update a resource.

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.

{
        "userId": 1,
        "title": " Alexander the Great",
        "body": " Alexander III of Macedon, commonly known as Alexander the Great, was a king of the ancient Greek kingdom of Macedon"
    }

Save the request and Click on the Send button. The record has been updated.

not found Postman Practice Exercises - QA Ads Banner

Proleed Academy

Proleed serves / offers professionally designed IT training courses
globally.

Copyright © 2023 - Proleed Academy | All Rights Reserved.