0
0
PostmanHow-ToBeginner ยท 4 min read

How to Make PUT Request in Postman: Step-by-Step Guide

To make a PUT request in Postman, select PUT from the HTTP method dropdown, enter the request URL, add any required headers and body data, then click Send. Postman will execute the request and show the response below.
๐Ÿ“

Syntax

A PUT request updates a resource at a specified URL. In Postman, you set the HTTP method to PUT, enter the URL, add headers like Content-Type, and provide the data to update in the request body.

  • HTTP Method: PUT
  • URL: The endpoint where the resource exists
  • Headers: Metadata like content type (usually application/json)
  • Body: The data to update, usually in JSON format
http
PUT https://api.example.com/resource/123
Headers:
  Content-Type: application/json
Body:
  {
    "name": "New Name",
    "status": "active"
  }
๐Ÿ’ป

Example

This example shows how to update a user's name and status using a PUT request in Postman.

json
{
  "name": "John Doe",
  "status": "active"
}
Output
HTTP/1.1 200 OK { "id": 123, "name": "John Doe", "status": "active" }
โš ๏ธ

Common Pitfalls

  • Forgetting to set the HTTP method to PUT and leaving it as GET or POST.
  • Not adding the correct Content-Type header, causing the server to reject the body.
  • Sending an empty or malformed JSON body.
  • Using the wrong URL or missing resource ID in the URL.
http
Wrong way:
POST https://api.example.com/resource/123
Body:
  {
    "name": "New Name"
  }

Right way:
PUT https://api.example.com/resource/123
Headers:
  Content-Type: application/json
Body:
  {
    "name": "New Name"
  }
๐Ÿ“Š

Quick Reference

StepAction
1Open Postman and select PUT method from dropdown
2Enter the full URL of the resource to update
3Go to Headers tab and add Content-Type: application/json
4Go to Body tab, select raw and JSON format, then enter update data
5Click Send to execute the PUT request
6Check response status and body for confirmation
โœ…

Key Takeaways

Always select PUT method in Postman to update resources.
Set Content-Type header to application/json when sending JSON data.
Include the full URL with resource ID to target the correct item.
Provide a valid JSON body with the updated data.
Review the response to confirm the update was successful.