In a proper REST API implementation, imagine I'm writing an API to let the user modify a uri slug, such as changing /acme/first
to be /acme/second
.
Depending if I'm submitting a partial record (patch
) or the whole record (put
) that currently represents first
, should the uri vary?
For example:
PUT /acme/second
{ [...], "current-slug": "first", "color": "blue" }
Put against the new uri because put
means "this goes here."
vs.
PATCH /acme/first
{ "new-slug": "second", "color": "blue" }
Patch against the old uri because patch
means "modify the thing that's here."
I suspect this is an edge case, but interesting because virtually all documentation happens to show the same uri for a put
vs patch
action, though obviously post
is generally a different uri.