Hi,
I just watched this video REST misconceptions, at 00:43 mins in the presenter proposes including state transitions in the links section.
I don't disagree with this but was curious where the boundary is drawn about imparting API usage in the media type, my interpretation is to aim is to be as explicit as possible, to reduce assumptions by/embedding knowledge in clients.
In the above example, is it implied that these links are called via say PUT requests? If not, how do you convey the verb(s) to use for these links?
Does it even matter? Do you return HTTP 405 Method Not Allowed if an inappropriate verb is used? (makes for clumsy usage?)
Example taken from slide:
{
"order": {
"state": "received",
"...": "...",
"links": {
{"rel": "cancel", "href": "http://..."},
{"rel": "accept", "href": "http://..."},
{"rel": "reject", "href": "http://..."}
}
}
}
Thanks, Greg