Re: Link Relations

Charles Reese <[email protected]> Sun, 10 Nov 2013 10:10:46 -0800
Newsgroups gmane.comp.web.services.rest
Message-ID <CAB44_Uc3rZE8wo-kf6uMTNmd+sK8W4YH+3yUx6XwB0JOhrMo2Q@mail.gmail.com>
Jan, Mike, dret:

I guess publishing is a bad example. As dret writes, I can use a status
field and watch when it changes.

So... a better one.

Suppose you want to create a dashboard for Twitter to manage all your
friends. You can start by creating a resource with a link relation called
"https:/friender.com/rels/friends" along with the usual methods:

POST: to follow
DELETE: to stop following
GET: returns a list of all your friends .

But there is an edge case... Last week, there was a Category 5 hurricane
that went right through data center, and while your site was down, your
users went to plain-old Twitter and added some friends.

Now your dashboard and twitter are out of sync. We need to be able to add
"friends" without creating them on Twitter.

I'm wondering how you all would approach.

Cheers,
Charles


On Sun, Nov 10, 2013 at 8:42 AM, Erik Wilde <[email protected]> wrote:

> hey jan.
>
> > On Nov 10, 2013, at 2:23, Jan Algermissen <[email protected]>
> wrote:
> > Make the state a resource and modify that:
> >
> > PUT /playlist/77626/state
> > Content-Type: application/vnd.foo.state
> >
> > <state>live</state>
> >
> > Personally, I aim for avoiding the need to introduce a media type for
> this ...
>
> why create a separate media type? you're designing the playlist media type
> anyway, including a fragment that's embedded in the playlist representation
> to indicate the playlist status. simply allow PUT on a linked sub-resource
> with the exact same syntax. all you have to do is create a new
> document/message type in your media type: problem solved.
>
> cheers,
>
> dret.




On Sun, Nov 10, 2013 at 8:42 AM, Erik Wilde <[email protected]> wrote:

> hey jan.
>
> > On Nov 10, 2013, at 2:23, Jan Algermissen <[email protected]>
> wrote:
> > Make the state a resource and modify that:
> >
> > PUT /playlist/77626/state
> > Content-Type: application/vnd.foo.state
> >
> > <state>live</state>
> >
> > Personally, I aim for avoiding the need to introduce a media type for
> this ...
>
> why create a separate media type? you're designing the playlist media type
> anyway, including a fragment that's embedded in the playlist representation
> to indicate the playlist status. simply allow PUT on a linked sub-resource
> with the exact same syntax. all you have to do is create a new
> document/message type in your media type: problem solved.
>
> cheers,
>
> dret.