Reputation: 3675
What is best practice for renaming a resource in a RESTful way? Let's say my users can maintain named lists of things with the uri
http://example.org/users/{userName}/lists/{listName}
I want to give my users an API to rename a certain list. What is the preferred way?
I came up with the following so far:
What is the right way to do this?
Upvotes: 18
Views: 3349
Reputation: 730
First step is fine, but I suggest you not to delete old URI, because every link to that resource will be break. instead return HTTP Code 301 "Moved Permanently"
http://en.wikipedia.org/wiki/HTTP_301
Upvotes: 9