How to Make PATCH Request in Postman: Step-by-Step Guide
To make a
PATCH request in Postman, select PATCH from the HTTP method dropdown, enter the request URL, and add the data you want to update in the Body tab using JSON format. Then click Send to execute the request and see the response.Syntax
A PATCH request updates partial data on the server. In Postman, the syntax involves:
- HTTP Method: Select
PATCHfrom the dropdown. - URL: Enter the API endpoint you want to update.
- Headers: Usually include
Content-Type: application/jsonto specify JSON data. - Body: Provide the JSON with fields to update.
http
PATCH https://api.example.com/items/123 Headers: Content-Type: application/json Body: { "name": "Updated Item Name" }
Example
This example shows how to update the "name" field of an item with ID 123 using a PATCH request in Postman.
http
PATCH https://api.example.com/items/123 Headers: Content-Type: application/json Body: { "name": "Updated Item Name" }
Output
{
"id": 123,
"name": "Updated Item Name",
"description": "Original description",
"price": 25.00
}
Common Pitfalls
Common mistakes when making PATCH requests in Postman include:
- Not selecting
PATCHmethod and usingPUTorPOSTinstead. - Forgetting to set
Content-Type: application/jsonheader, causing the server to reject the data. - Sending the full object instead of only the fields to update, which can overwrite data unintentionally.
- Using incorrect JSON syntax in the body.
http
Wrong way: POST https://api.example.com/items/123 Headers: Content-Type: application/json Body: { "name": "Updated Item Name" } Right way: PATCH https://api.example.com/items/123 Headers: Content-Type: application/json Body: { "name": "Updated Item Name" }
Quick Reference
| Step | Action |
|---|---|
| 1 | Open Postman and select PATCH method from dropdown |
| 2 | Enter the API endpoint URL |
| 3 | Go to Headers tab and add Content-Type: application/json |
| 4 | Go to Body tab, select raw and JSON format, then enter fields to update |
| 5 | Click Send to execute the PATCH request |
Key Takeaways
Always select PATCH method in Postman to update partial data.
Set Content-Type header to application/json when sending JSON data.
Include only the fields you want to update in the request body.
Check JSON syntax carefully to avoid request errors.
Use the Body tab with raw JSON format to send update data.