users@jersey.java.net

[Jersey] Re: Migrating to more RESTful API

From: Jason Erickson <jason_at_jasonerickson.com>
Date: Wed, 18 May 2011 09:44:00 -0700

No, they aren't. I've posted my question and a followup question based on my confusion around this particular issue of clients following the hypermedia constraint, but as a server developer, I would hate to be in a position to have to trust that the clients are well written.


On May 17, 2011, at 11:05 PM, algermissen1971 wrote:

>
>
> On 18 May, 2011,at 07:44 AM, algermissen1971 <algermissen1971_at_mac.com> wrote:
>
>>> I would like to fix this in a backward compatible way. I'm not firm on the new URL - but say it's ws/users/{userid}/config/savedCriteria.
>>>
>>> When an older client makes a request to ws/savedCriteria with an authenticated user = foouser, should I return a 301 with ws/users/foouser/config/savedCriteria? Every distinct user who requests ws/savedCriteria will be redirected to a different URL, so a "Moved Permanently" seems not quite right.
>>
>> Why not? The redirect is permanent for this authenticated user. 301 is fine.
>
> Uuhh - my bad. I have to correct that.
>
> 301 responses can be cached - so thi is probably not the best idea.
>
> You could mark the response as non-cacheable .. but this is semantically not quite right either then.
>
>
>
> Actually, if your older clients do adhere the hypermedia constraint they would not simply remember this URI but discover it. In that case, they would discover the new URI and all would be fine.
>
> Are the older clients programmed this way?
>
> Jan
>