Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RESTful Web Service usage of custom link relations - 'rel'

I'm working on a RESTful service and have been focusing on Discoverability, Link relations - 'rel' and microformats. I'm not clear about the values of 'rel' in the context of REST - am I allowed to make use of any custom value, to provide richer semantics or should I only use the default values (which are very constraining)?

I am aware that microformats have indeed extended the values of 'rel', but I am not using any kind of microformat yet.

Any help is appreciated. Thanks.

like image 784
Eugen Avatar asked Nov 06 '11 09:11

Eugen


1 Answers

Link Relations (rel) are one of the two ways that you can convey semantics to a client. The other way is media types.

The best spec to read on Web linking is here https://www.rfc-editor.org/rfc/rfc5988.

The link relation registry is here http://www.iana.org/assignments/link-relations/link-relations.xml.

And for an example of how to use link relations to convey semantics you can look a the Hal media type. It is a generic media type that uses link relations to convey all of its semantic meaning. http://stateless.co/hal_specification.html

like image 130
Darrel Miller Avatar answered Oct 30 '22 10:10

Darrel Miller