3 ms·
> Sure, the server is sending the new link but the client doesn't know that new link is really the new comment link that it's expecting so the client has to be
by vidarh 14y ago
> Sure, the server is sending the new link but the client doesn't know that new link is really the new comment link that it's expecting so the client has to be updated anyway.
Then you're doing it wrong.
See the article example. E.g.:
<link rel = "/linkrels/entry/newcomment"
uri = "/entries/1337/comments" />
The "rel" attribute remains static. You don't change that. It is what tells your client that "this link is a new comment link".
The "uri" attribute can change at will.
The client knows that "/linkrels/entry/newcomment" means that this is the link to follow to post comments to this entry.
It does not need to be updated when the url's to server resources change, as long as the "rel" attributes stay the same.
- Osiris 14y agoI was referring to the rel attribute, not the uri. So your point is that once the server establishes a defined API that it can't change in order to maintain compatibility with the client, which is the need for API versioning. So the client still has to be updated when the API changes. I suppose it provides a little flexibility for the API to adjust the endpoints, but in practice it still seems like a bad idea to modify the endpoints because clients could have cached data pointing to existing endpoints that you now break.