C# Interview Question #187

What is the difference between PUT and PATCH?

Testing, Security, APIs & Reliability Senior Advanced

Quick Interview Answer

PUT generally represents replacing the state of a resource at a known URI with the supplied representation. It is normally expected to be idempotent.

Detailed Explanation

PUT generally represents replacing the state of a resource at a known URI with the supplied representation. It is normally expected to be idempotent.

PATCH represents a partial modification where only selected changes are supplied.

In real APIs, exact semantics should be clearly documented and implemented consistently. PATCH can use formats such as JSON Patch or application-specific update DTOs, depending on API requirements.