Independent Submission                                   I. Dzmanashvili
Request for Comments: 6861                                  January 2013
Category: Informational
ISSN: 2070-1721
        
Independent Submission                                   I. Dzmanashvili
Request for Comments: 6861                                  January 2013
Category: Informational
ISSN: 2070-1721
        

The "create-form" and "edit-form" Link Relations

“创建表单”和“编辑表单”链接关系

Abstract

摘要

RFC 5988 standardized a means of indicating the relationships between resources on the Web. This specification defines link relation types that may be used to express the relationships between a resource and an input form for constructing data submissions.

RFC 5988标准化了一种表示Web上资源之间关系的方法。本规范定义了链接关系类型,可用于表示资源和输入表单之间的关系,以构建数据提交。

Status of This Memo

关于下段备忘

This document is not an Internet Standards Track specification; it is published for informational purposes.

本文件不是互联网标准跟踪规范;它是为了提供信息而发布的。

This is a contribution to the RFC Series, independently of any other RFC stream. The RFC Editor has chosen to publish this document at its discretion and makes no statement about its value for implementation or deployment. Documents approved for publication by the RFC Editor are not a candidate for any level of Internet Standard; see Section 2 of RFC 5741.

这是对RFC系列的贡献,独立于任何其他RFC流。RFC编辑器已选择自行发布此文档,并且未声明其对实现或部署的价值。RFC编辑批准发布的文件不适用于任何级别的互联网标准;见RFC 5741第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc6861.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc6861.

Copyright Notice

版权公告

Copyright (c) 2013 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2013 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。

Table of Contents

目录

   1. Introduction ....................................................2
   2. Notational Conventions ..........................................2
   3. Link Relations ..................................................3
      3.1. The "create-form" Link Relation Type .......................3
           3.1.1. Using the "create-form" Link Relation ...............3
      3.2. The "edit-form" Link Relation Type .........................3
           3.2.1. Using the "edit-form" Link Relation .................4
      3.3. Error-Handling Example .....................................4
   4. IANA Considerations .............................................4
      4.1. The Link Relation Registration "create-form" ...............4
      4.2. The Link Relation Registration "edit-form" .................5
   5. Security Considerations .........................................5
   6. Internationalisation Considerations .............................5
   7. Normative References ............................................5
   Appendix A. Acknowledgements .......................................6
        
   1. Introduction ....................................................2
   2. Notational Conventions ..........................................2
   3. Link Relations ..................................................3
      3.1. The "create-form" Link Relation Type .......................3
           3.1.1. Using the "create-form" Link Relation ...............3
      3.2. The "edit-form" Link Relation Type .........................3
           3.2.1. Using the "edit-form" Link Relation .................4
      3.3. Error-Handling Example .....................................4
   4. IANA Considerations .............................................4
      4.1. The Link Relation Registration "create-form" ...............4
      4.2. The Link Relation Registration "edit-form" .................5
   5. Security Considerations .........................................5
   6. Internationalisation Considerations .............................5
   7. Normative References ............................................5
   Appendix A. Acknowledgements .......................................6
        
1. Introduction
1. 介绍

RFC 5988 [RFC5988] standardized a means of indicating the relationships between resources on the Web. This specification defines link relation types that may be used to express the relationships between a resource and an input form for constructing data submissions.

RFC 5988[RFC5988]标准化了一种表示Web上资源之间关系的方法。本规范定义了链接关系类型,可用于表示资源和输入表单之间的关系,以构建数据提交。

The "create-form" and "edit-form" link relations are intentionally generic, and they can be used with multiple media types in a wide variety of use cases.

“创建表单”和“编辑表单”链接关系是有意通用的,它们可以在各种各样的用例中与多种媒体类型一起使用。

2. Notational Conventions
2. 符号约定

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照[RFC2119]中所述进行解释。

3. Link Relations
3. 链接关系

The following link relations are defined.

定义了以下链接关系。

3.1. The "create-form" Link Relation Type
3.1. “创建表单”链接关系类型

When included in a response, the "create-form" link relation indicates a target resource that represents a form that can be used to append a new member to the link context.

当包含在响应中时,“创建表单”链接关系表示一个目标资源,该资源表示可用于将新成员附加到链接上下文的表单。

   <html>
     <ul>
       <li>Entry Description 1</li>
       <li>Entry Description 2</li>
     </ul>
     <a href="..." rel="create-form">[Add New Entry]</a>
   </html>
        
   <html>
     <ul>
       <li>Entry Description 1</li>
       <li>Entry Description 2</li>
     </ul>
     <a href="..." rel="create-form">[Add New Entry]</a>
   </html>
        

or, expressed as a Link header

或者,表示为链接头

   Link: <...>; rel="create-form"; title="Add New Entry"
        
   Link: <...>; rel="create-form"; title="Add New Entry"
        
3.1.1. Using the "create-form" Link Relation
3.1.1. 使用“创建表单”链接关系

If the form representation includes a submission URI, this URI MUST be used to submit the form. The context URI SHOULD be used otherwise.

如果表单表示包含提交URI,则必须使用此URI提交表单。否则应使用上下文URI。

If the form representation includes a submission method, this method MUST be used for submit requests. HTTP's POST method SHOULD be used otherwise.

如果表单表示包含提交方法,则此方法必须用于提交请求。否则应使用HTTP的POST方法。

3.2. The "edit-form" Link Relation Type
3.2. “编辑表单”链接关系类型

When included in a response, the "edit-form" link relation indicates a target resource that represents a form that can be used for updating the context resource.

当包含在响应中时,“编辑表单”链接关系表示表示可用于更新上下文资源的表单的目标资源。

   <html>
    ...
    <ul>
      <li>
        Entry Description 1
        <a href="..." rel="edit-form">[Edit Entry]</a>
      </li>
    </ul>
    ...
   </html>
        
   <html>
    ...
    <ul>
      <li>
        Entry Description 1
        <a href="..." rel="edit-form">[Edit Entry]</a>
      </li>
    </ul>
    ...
   </html>
        

or, expressed as a Link header

或者,表示为链接头

   Link: <...>; rel="edit-form"; title="Edit Entry"
        
   Link: <...>; rel="edit-form"; title="Edit Entry"
        
3.2.1. Using the "edit-form" Link Relation
3.2.1. 使用“编辑表单”链接关系

If the form representation includes a submission URI, this URI MUST be used to submit the form. The context URI SHOULD be used otherwise.

如果表单表示包含提交URI,则必须使用此URI提交表单。否则应使用上下文URI。

If the form representation includes a submission method, this method MUST be used for submit requests. HTTP's PUT method SHOULD be used otherwise.

如果表单表示包含提交方法,则此方法必须用于提交请求。否则应使用HTTP的PUT方法。

3.3. Error-Handling Example
3.3. 错误处理示例

When submitting forms in unsupported media type format, service may respond to the client with HTTP's 415 Unsupported Media Type status code.

当以不支持的媒体类型格式提交表单时,服务可以使用HTTP的415不支持的媒体类型状态代码响应客户端。

     HTTP/1.1 415 Unsupported Media Type
     Link: <...>; rel="create-form"; title="Create new entry"
     Content-Type: text/html
     Content-Length: ...
        
     HTTP/1.1 415 Unsupported Media Type
     Link: <...>; rel="create-form"; title="Create new entry"
     Content-Type: text/html
     Content-Length: ...
        
     <html>
       Use <a href="..." rel="create-form">
         this form
       </a> to create a new entry.
     </html>
        
     <html>
       Use <a href="..." rel="create-form">
         this form
       </a> to create a new entry.
     </html>
        
4. IANA Considerations
4. IANA考虑

IANA has registered the "create-form" and "edit-form" link relations below as per [RFC5988].

IANA已根据[RFC5988]注册了以下“创建表单”和“编辑表单”链接关系。

4.1. The Link Relation Registration "create-form"
4.1. 链接关系注册“创建表单”

Relation Name:

关系名称:

create-form

创建表单

Description:

说明:

The target IRI points to a resource where a submission form can be obtained.

目标IRI指向可以获得提交表单的资源。

Security considerations:

安全考虑:

Automated agents should take care when this relation crosses administrative domains (e.g., the URI has a different authority than the current document).

当这种关系跨越管理域时,自动化代理应该注意(例如,URI与当前文档具有不同的权限)。

Reference:

参考:

See Section 3.

见第3节。

4.2. The Link Relation Registration "edit-form"
4.2. 链接关系注册“编辑表单”

Relation Name:

关系名称:

edit-form

编辑表格

Description:

说明:

The target IRI points to a resource where a submission form for editing the associated resource can be obtained.

目标IRI指向可以获得用于编辑关联资源的提交表单的资源。

Security Considerations:

安全考虑:

Automated agents should take care when this relation crosses administrative domains (e.g., the URI has a different authority than the current document).

当这种关系跨越管理域时,自动化代理应该注意(例如,URI与当前文档具有不同的权限)。

Reference:

参考:

See Section 3.

见第3节。

5. Security Considerations
5. 安全考虑

See Section 7 of RFC 5988 [RFC5988].

参见RFC 5988[RFC5988]第7节。

6. Internationalisation Considerations
6. 国际化考虑

See Section 8 of RFC 5988 [RFC5988].

参见RFC 5988[RFC5988]第8节。

7. Normative References
7. 规范性引用文件

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[RFC5988] Nottingham, M., "Web Linking", RFC 5988, October 2010.

[RFC5988]诺丁汉,M.,“网络链接”,RFC 5988,2010年10月。

Appendix A. Acknowledgements
附录A.确认书

The author gratefully acknowledges the contributions of Jan Algermissen.

作者衷心感谢扬·阿尔格米森的贡献。

Author's Address

作者地址

Ioseb Dzmanashvili

Ioseb Dzmanashvili

   EMail: ioseb.dzmanashvili@gmail.com
        
   EMail: ioseb.dzmanashvili@gmail.com