Reputation: 1758
I have (JSON for) a resource like this at /api/foo/1/
{name: "foo", bar_pks: [10, 11, 12]}
Now I want to add an API for appending to bar_pks
. There is no HTTP verb for appending I can find. If I do a patch to /api/foo/1/
with {bar_pks: [13]}
, it will overwrite, not append.
patch
for this resource to always do an append, will it come to bite me later?(I am using Django and Tastypie, but would prefer a language agnostic answer.)
Upvotes: 0
Views: 255
Reputation: 13682
Is there a compelling reason not to do the append on the client side and use a PUT/PATCH to send the updated value back to the server?
I see a couple of options if you're dead-set on doing this:
Neither of these are good options, and I do not endorse using them.
Upvotes: 2