API Design · Middle · Question 63 of 75
When might PUT with a full document be better than PATCH?
- 1Only for file uploads
- 2Never; PATCH is always better
- ✓Correct answer: When clients always have the full resource (e.g. a settings form) and replacing it is simpler and idempotent
Explanation
Combine PUT with If-Match to avoid overwriting someone else's changes.