Response body when PATCHing a collection

This question is based on a misconception:

While either method would require very different request bodies I believe both methods would require the exact same response body, i.e. the response body would have to contain the current representation of the entire updated resource

Either can just return 204 No Content or 200 OK and no response body. There’s no requirement that they include the full representation in the response.

You could optionally support this (perhaps along with the Prefer: return=representation header, or perhaps Content-Location header), but without this header I would say it’s not even a convention that the current representation is returned. Generic clients shouldn’t assume that the response body is the new representation unless these headers are used.

So, just return a 2xx and you’re good to go.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top