API Fundamentals
/Intermediate
PATCH
Definition
An HTTP method used to apply partial modifications to a resource.
Explain Like I'm New
While PUT replaces the entire car, PATCH just replaces the tires. You only send the exact specific pieces of data that you want to change, and the server leaves everything else completely alone.
Real World Example
A user clicks a 'Like' button. You don't want to download their entire profile and upload it again (PUT). You just send a PATCH request saying `{ "likes": +1 }`.
Common Use Cases
- •Partial updates
- •Saving bandwidth
Interactive Example
Loading...
Console output will appear here...
Interview Questions
basic
- If you only want to update a user's email address, which method should you use: PUT or PATCH?
intermediate
- Why is PATCH generally preferred over PUT in modern REST APIs?