自定义链接关系的 RESTful Web 服务使用 - 'rel' [英] RESTful Web Service usage of custom link relations - 'rel'

查看:47
本文介绍了自定义链接关系的 RESTful Web 服务使用 - 'rel'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究 RESTful 服务,并且一直专注于可发现性、链接关系 - 'rel' 和微格式.我不清楚 REST 上下文中 '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)?

我知道微格式确实扩展了rel"的值,但我还没有使用任何类型的微格式.

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

感谢任何帮助.谢谢.

推荐答案

链接关系 (rel) 是向客户端传达语义的两种方式之一.另一种方式是媒体类型.

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

有关网络链接的最佳规范在这里http://tools.ietf.org/html/rfc5988.

The best spec to read on Web linking is here http://tools.ietf.org/html/rfc5988.

链接关系注册表在这里 http://www.iana.org/assignments/link-relations/link-relations.xml.

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

对于如何使用链接关系传达语义的示例,您可以查看 Hal 媒体类型.它是一种使用链接关系来传达其所有语义含义的通用媒体类型.http://stateless.co/hal_specification.html

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

这篇关于自定义链接关系的 RESTful Web 服务使用 - 'rel'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆