SteelReed

Search

Search posts, questions…

Web & REST APIQuestion 9 / 25

Junior

How do PUT and PATCH differ, and how does that affect DTO design?

Short answer

PUT sends all the new data: a field you leave out is treated as removed. PATCH sends only what changes, so it must tell "not sent" apart from "sent as null".

PUT name + phonePATCHhas a valuesent nullnot sentuser: name, phone, emailemail goneor reset to defaultphone field?update phoneclear phonekeep as is

3 points to say:

  1. PUT replaces everything and is idempotent.
  2. PATCH: absent differs from null.
  3. Concurrent edits use If-Match.

Keep reading the deep dive

Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.