What is the HTTP Patch Method? (computing) Definition | API Glossary (2024)

An Introduction to the HTTP PATCH Method

HyperText Transfer Protocol (HTTP) specifies the way in which clients and servers on the World Wide Web communicate with each other.

This communication is accomplished through the use of HTTP request methods.

For example, the most commonly used method, GET, is used by a client to request that a web server provide a specified resource.

This is the method that your web browser sends when requesting that a web page begin loading a particular page. GET is not the only HTTP method provided by the HTTP protocol, however.

Another, more specialized HTTP method is PATCH.

Patch Example

Consider a resource, employee. The JSON representation of an example might look like this:

{ "name":"John Doe", "department":"sales", "salary":65500}

If the salary field of this employee record needed updating, the PUT method could be used to replace the employee, but this would be wasteful.

{"name":"John Doe", "department":"sales", "salary":70000}

The PATCH command could be used instead to send only the new salary:

{"salary":70000}

In the trivial example presented here, the savings from using PATCH is obviously very small, but for a more complex case, where objects contain much more data, the savings could be very material.

Patch vs PUT

The HTTP PATCH method can be used when a resource needs to be updated. This method is especially useful if a resource is large and the changes being made are small.

The HTTP PUT method can be used to create a new resource or to replace an existing resource with a new resource. However, the entire resource must be replaced.

There are some cautions to keep in mind when choosing to use PATCH over PUT. PUT is guaranteed to be idempotent. PATCH is not. Likewise, PUT is considered “safe” in the sense of RFC 2616, while PATCH is not.

Summary

The PATCH method could return a number of different status codes. For a successful PATCH, common status codes would likely be 200 (OK) or 204 (No Content). If the PATCH method was unsuccessful, status codes such as 304 (Not Modified), 400 (Bad Request), or 422 (Unprocessable Entity) may be seen.

Many applications have potential benefits from the use of the PATCH command and it should certainly be considered when designing the methods a web application will support. Support for PATCH does bring with it more complex than required for support of PUT alone, but the benefits are absolutely worth considering.

What is the HTTP Patch Method? (computing) Definition | API Glossary (2024)
Top Articles
The 5 C's of Teamwork
What Should You Do If Your Spouse Empties Your Bank Account During A Divorce?
Devotion Showtimes Near Xscape Theatres Blankenbaker 16
NOAA: National Oceanic & Atmospheric Administration hiring NOAA Commissioned Officer: Inter-Service Transfer in Spokane Valley, WA | LinkedIn
AllHere, praised for creating LAUSD’s $6M AI chatbot, files for bankruptcy
Gore Videos Uncensored
Klustron 9
How To Get Free Credits On Smartjailmail
Here's how eating according to your blood type could help you keep healthy
Celsius Energy Drink Wo Kaufen
Student Rating Of Teaching Umn
A.e.a.o.n.m.s
Craigslist/Phx
The Rise of Breckie Hill: How She Became a Social Media Star | Entertainment
Used Wood Cook Stoves For Sale Craigslist
Fredericksburg Free Lance Star Obituaries
I Touch and Day Spa II
Who called you from +19192464227 (9192464227): 5 reviews
Weather Rotterdam - Detailed bulletin - Free 15-day Marine forecasts - METEO CONSULT MARINE
3476405416
Ruben van Bommel: diepgang en doelgerichtheid als wapens, maar (nog) te weinig rendement
Yard Goats Score
Myhr North Memorial
Busted News Bowie County
Drying Cloths At A Hammam Crossword Clue
Craigslist Rome Ny
Black Panther 2 Showtimes Near Epic Theatres Of Palm Coast
Effingham Daily News Police Report
How rich were the McCallisters in 'Home Alone'? Family's income unveiled
Www.1Tamilmv.con
Perry Inhofe Mansion
Mrstryst
Mbi Auto Discount Code
Vitals, jeden Tag besser | Vitals Nahrungsergänzungsmittel
Giantess Feet Deviantart
Linabelfiore Of
Afspraak inzien
Express Employment Sign In
Improving curriculum alignment and achieving learning goals by making the curriculum visible | Semantic Scholar
Aita For Announcing My Pregnancy At My Sil Wedding
814-747-6702
Nimbleaf Evolution
The Cutest Photos of Enrique Iglesias and Anna Kournikova with Their Three Kids
Keci News
Naomi Soraya Zelda
Slug Menace Rs3
Elvis Costello announces King Of America & Other Realms
Lux Funeral New Braunfels
Kidcheck Login
Mike De Beer Twitter
Convert Celsius to Kelvin
How to Choose Where to Study Abroad
Latest Posts
Article information

Author: Ouida Strosin DO

Last Updated:

Views: 5766

Rating: 4.6 / 5 (76 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Ouida Strosin DO

Birthday: 1995-04-27

Address: Suite 927 930 Kilback Radial, Candidaville, TN 87795

Phone: +8561498978366

Job: Legacy Manufacturing Specialist

Hobby: Singing, Mountain biking, Water sports, Water sports, Taxidermy, Polo, Pet

Introduction: My name is Ouida Strosin DO, I am a precious, combative, spotless, modern, spotless, beautiful, precious person who loves writing and wants to share my knowledge and understanding with you.