What would be the best way to represent a HATEOAS link for a POST
/PUT
/PATCH
on a resource? These operations have payload but we won\'t
Links are comprised of two elements: href
and rel
. The href
contains the explicit URL to locate a resource. The rel
identifies the relationship between the current resource and the link's resource. The rel
should be used to determine what HTTP method is acceptable and how the link should be used.
The following is a quote from RESTful Web Services Cookbook section 5.4:
A link relation type conveys the role or purpose of a link. Once clients and servers agree on the meaning of these types, clients can find and use URIs from links.
For example, edit
is a standard link relation that has explicit details including details around using GET
, PUT
, POST
, DELETE
.
Link relations can be extended and you can add your own.