I've come across a situation in my webservice where in I've to delete a resource and update the other resources which are referring to this resource with other resource specified by user. How can I achieve this in RESTful way?
For example: DELETE resource Agent/123 Some customers might be assigned to this agent, hence while deleting the Agent 123 user will specify another agent 125 for all these customers.
I thought of following ways:
DELETE request on the url Agent/123/125 On the server I'll handle this request at url Agent/123 and new agent id will be taken as 125. I felt this is completely away from RESTful way, so thought of dropping this idea. Please let me know whether this restful way.
Another option is: Delete Agent/123?ReAssignId=125
I'm not sure whether this is also restful way or not, I've come across this method in this question. I'm still not convinced with this strategy as well.
Have any one come across this situation, how this situation should be handled in Restful way?