Florian Fankhauser
Florian Fankhauser

Reputation: 3675

Rename a resource in a RESTful way

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

Answers (1)

rachvela
rachvela

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

Related Questions