[Answered ]-Is it okay to use patch for full update instead of put?

2đź‘Ť

âś…

It’s OK to use PATCH. However, note that it will not check for required fields as opposed to PUT.

👤Linovia

0đź‘Ť

It’s not OK to use PATCH unless you use a media type that has defined semantics for PATCH. “application/json” does not.

See https://www.rfc-editor.org/errata_search.php?eid=3169:

If the operation does not modify the resource identified by the
Request-URI in a predictable way that’s defined by the semantics
of the PATCH media type, POST should be considered instead of
PATCH or PUT.

FWIW, see RFC 6902 and RFC 7386 for types you could use.

Leave a comment