REST: Should I redirect to the version URL of an entity?

Posted by sfussenegger on Stack Overflow See other posts from Stack Overflow or by sfussenegger
Published on 2010-04-02T16:36:00Z Indexed on 2010/04/02 16:43 UTC
Read the original article Hit count: 330

Filed under:
|
|

I am currently working on a REST service. This service has an entity which has different versions, similar to Wikipedia articles.

Now I'm wondering what I should return if for

GET /article/4711

Should I use a (temporary) redirect to the current version, e.g.

GET /article/4711/version/7

Or should I return the current version directly? Using redirects would considerably simplify HTTP caching (using Last-Modified) but has the disadvantages a redirect has (extra request, 'harder' to implement). Therefore I'm not sure whether this is good practice though.

Any suggestions, advise, or experiences to share?

(btw: ever tried search for "REST Version"? Everything you get is about the version of the API rather than entities. So please bear with me if this is a duplicate.)

© Stack Overflow or respective owner

Related posts about rest

Related posts about best-practices