idnits 2.17.1 draft-snell-link-method-11.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (October 16, 2014) is 3481 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 5988 (Obsoleted by RFC 8288) ** Obsolete normative reference: RFC 7231 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7232 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 7234 (Obsoleted by RFC 9111) -- Obsolete informational reference (is this intentional?): RFC 2068 (Obsoleted by RFC 2616) Summary: 4 errors (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Individual Submission J. Snell 3 Internet-Draft 4 Intended status: Standards Track October 16, 2014 5 Expires: April 19, 2015 7 HTTP Link and Unlink Methods 8 draft-snell-link-method-11 10 Abstract 12 This specification defines the semantics of the LINK and UNLINK HTTP 13 methods. 15 Status of This Memo 17 This Internet-Draft is submitted to IETF in full conformance with the 18 provisions of BCP 78 and BCP 79. 20 Internet-Drafts are working documents of the Internet Engineering 21 Task Force (IETF). Note that other groups may also distribute 22 working documents as Internet-Drafts. The list of current Internet- 23 Drafts is at http://datatracker.ietf.org/drafts/current/. 25 Internet-Drafts are draft documents valid for a maximum of six months 26 and may be updated, replaced, or obsoleted by other documents at any 27 time. It is inappropriate to use Internet-Drafts as reference 28 material or to cite them other than as "work in progress." 30 This Internet-Draft will expire on April 19, 2015. 32 Copyright Notice 34 Copyright (c) 2014 IETF Trust and the persons identified as the 35 document authors. All rights reserved. 37 This document is subject to BCP 78 and the IETF Trust's Legal 38 Provisions Relating to IETF Documents 39 (http://trustee.ietf.org/license-info) in effect on the date of 40 publication of this document. Please review these documents 41 carefully, as they describe your rights and restrictions with respect 42 to this document. 44 Table of Contents 46 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 47 2. Link Relationships . . . . . . . . . . . . . . . . . . . . . 2 48 3. LINK . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 49 4. UNLINK . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 50 5. Relationship to other HTTP Methods and Discoverability of 51 Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 52 6. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 53 7. Security Considerations . . . . . . . . . . . . . . . . . . . 6 54 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 55 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 56 9.1. Normative References . . . . . . . . . . . . . . . . . . 7 57 9.2. Informational References . . . . . . . . . . . . . . . . 7 58 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 7 60 1. Introduction 62 This specification updates the HTTP LINK and UNLINK methods 63 originally defined in [RFC2068]. 65 In this document, the key words "MUST", "MUST NOT", "REQUIRED", 66 "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", 67 and "OPTIONAL" are to be interpreted as described in [RFC2119]. 69 2. Link Relationships 71 The LINK and UNLINK methods are used to manage relationships between 72 resources. Those relationships are defined using the Link model 73 established in Section 3 of [RFC5988]. For every individual link, 74 the context IRI, link relation type, target IRI, and optional 75 collection of target attributes MUST be considered; that is, for any 76 effective request URI, there can exist at most one Link relationship 77 between any context and target IRI pairing with any given combination 78 of link relation type and target attributes. 80 Within LINK and UNLINK requests, a [RFC5988] Link header field is 81 used to describe a Link relationship to be managed. Any single LINK 82 or UNLINK request MAY contain multiple Link header fields, each of 83 which describes a separate relationship between a context IRI and 84 target IRI. When a LINK request contains multiple Link header 85 fields, the server MUST create all of the specified relationships or 86 not create any of them. Likewise, when an UNLINK request contains 87 multiple Link header fields, the server MUST either remove all the 88 specified relationship or not remove any of them. 90 The target and context IRIs of a Link relationship are determined 91 following the requirements specified in Sections 5.1 and 5.2 of 92 [RFC5988]. 94 When determining whether or not a relationship already exists between 95 a context IRI and target IRI, implementations will need to compare 96 the given IRIs with other, previously established relationships. To 97 do so, the implementation MUST first resolve the IRIs as required by 98 [RFC5988] and then compare on a case-sensitive, character-by- 99 character basis. For instance, the IRIs "http://example.org/foo" and 100 "http://example.org/Foo" MUST NOT be considered to be equivalent. 102 3. LINK 104 The LINK method is used to establish one or more relationships 105 between the resource identified by the effective request URI and one 106 or more other resources. Metadata contained within Link header 107 fields [RFC5988] provide information about the relationships being 108 established. A payload within a LINK request has no defined 109 semantics. 111 LINK requests are idempotent but are not safe. Establishing a 112 relationship causes an inherent change to the state of the target 113 resource. 115 Any successful response (using a 2xx status code) to a LINK request 116 indicates that all of the Link relationships described in the request 117 have been established. No specific 2xx status code is required. 119 Responses to LINK requests SHOULD contain one Link header field for 120 each Link relationship established by the LINK request. 122 Responses to LINK requests are not cacheable. If a LINK request 123 passes through a cache that has one or more stored responses for the 124 effective request URI, those stored responses will be invalidated 125 (see Section 6 of [RFC7234]). 127 The semantics of the LINK method change to a "conditional LINK" if 128 the request message includes an If-Modified-Since, If-Unmodified- 129 Since, If-Match, If-None-Match, or If-Range header field ([RFC7232]). 130 A conditional LINK requests that the relationship be established only 131 under the circumstances described by the conditional header field(s). 133 4. UNLINK 135 The UNLINK method is used to remove one or more relationships between 136 the resource identified by the effective request URI and other 137 resources. Metadata contained within Link header fields [RFC5988] 138 provide the information about the relationships that are to be 139 removed. A payload within an UNLINK request has no defined 140 semantics. 142 UNLINK request messages are idempotent but are not safe. Removing a 143 relationship causes an inherent change to the state of the target 144 resource. 146 Responses to UNLINK requests SHOULD contain one Link header field for 147 each Link relationship removed by the UNLINK request. 149 Any successful response (using a 2xx status code) to an UNLINK 150 request indicates that all of the Link relationships described in the 151 request have been removed. No specific 2xx status code is required. 153 Responses to UNLINK requests are not cacheable. If an UNLINK request 154 passes through a cache that has one or more stored responses for the 155 effective request URI, those stored responses will be invalidated 156 (see Section 6 of [RFC7234]). 158 The semantics of the UNLINK method change to a "conditional UNLINK" 159 if the request message includes an If-Modified-Since, If-Unmodified- 160 Since, If-Match, If-None-Match, or If-Range header field ([RFC7232]). 161 A conditional UNLINK requests that the relationship be established 162 only under the circumstances described by the conditional header 163 field(s). 165 5. Relationship to other HTTP Methods and Discoverability of Links 167 The use of the LINK and UNLINK request methods to manage 168 relationships between resources has no direct bearing on the use or 169 appearance of Link header fields within any other HTTP request or 170 response message involving the same effective request URI. Nor do 171 the methods have any direct normative impact on the use of link-like 172 structures within the resource representations returned by a server 173 for any particular resource. 175 Whether and how to represent relationships managed using LINK and 176 UNLINK is left solely at the discretion of the server implementation. 178 This specification does not define a means of discovering or 179 enumerating the relationships that have been established using the 180 LINK request method. 182 6. Example 184 There exists a broad range of possible use cases for the LINK and 185 UNLINK methods. The examples that follow illustrate a subset of 186 those cases. 188 Example 1: Creating two separate links between an image and the 189 profiles of two people associated with the image: 191 LINK /images/my_dog.jpg HTTP/1.1 192 Host: example.org 193 Link: ; rel="tag" 194 Link: ; rel="tag" 196 Possible response: 198 HTTP/1.1 202 Accepted 199 Link: ; rel="tag" 200 Link: ; rel="tag" 202 Example 2: Removing an existing Link relationship between two 203 resources: 205 UNLINK /images/my_dog.jpg HTTP/1.1 206 Host: example.org 207 Link: ; rel="tag" 209 Possible response: 211 HTTP/1.1 204 No Content 212 Link: ; rel="tag" 214 Example 3: Establish a "pingback" or "trackback" style link to a blog 215 entry about an article 217 LINK /articles/an_interesting_article HTTP/1.1 218 Host: example.org 219 Link: ; rel="mention" 221 Example 4: Establish a link between two semantically related 222 resources: 224 LINK /some-resource HTTP/1.1 225 Host: example.org 226 Link: ; rel="describedBy" 228 Example 5: Add an existing resource to a collection: 230 LINK /some-collection-resource HTTP/1.1 231 Host: example.org 232 Link: ; rel="item" 234 Example 6: Link one resource to another that monitors its current 235 state (e.g. pub/sub) 237 LINK /my-resource HTTP/1.1 238 Host: example.org 239 Link: ; rel="monitor" 241 Example 7: Using the Link anchor attribute to change the context IRI 242 (in this example, a link relationship is established between the IRIs 243 "acct:joe@example.org" and "acct:sally@example.org") 245 LINK /my-resource HTTP/1.1 246 Host: example.org 247 Link: ; rel="follow"; 248 anchor="acct:sally@example.org" 250 Example 8: Using fragment identifiers to establish links with 251 embedded resources. In this example, a link relationship is 252 established between "http://example.org/alice#me" and 253 "http://example.org/bob#me". 255 LINK /alice HTTP/1.1 256 Host: example.org 257 Link: ; rel="knows"; anchor="#me" 259 7. Security Considerations 261 The LINK and UNLINK methods are subject to the same general security 262 considerations as all HTTP methods as described in [RFC7231]. 264 Because the LINK and UNLINK methods cause changes to a resource's 265 state, the server is responsible for determining the client's 266 authorization to make such changes. 268 8. IANA Considerations 270 IANA is requested to add the LINK and UNLINK methods to the permanent 271 registry at (see 272 Section 8.1 of [RFC7231]). 274 +-------------+------+------------+---------------+ 275 | Method Name | Safe | Idempotent | Specification | 276 +-------------+------+------------+---------------+ 277 | LINK | No | Yes | Section 3 | 278 | UNLINK | No | Yes | Section 4 | 279 +-------------+------+------------+---------------+ 281 9. References 283 9.1. Normative References 285 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 286 Requirement Levels", BCP 14, RFC 2119, March 1997. 288 [RFC5988] Nottingham, M., "Web Linking", RFC 5988, October 2010. 290 [RFC7231] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol 291 (HTTP/1.1): Semantics and Content", RFC 7231, June 2014. 293 [RFC7232] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol 294 (HTTP/1.1): Conditional Requests", RFC 7232, June 2014. 296 [RFC7234] Fielding, R., Nottingham, M., and J. Reschke, "Hypertext 297 Transfer Protocol (HTTP/1.1): Caching", RFC 7234, June 298 2014. 300 9.2. Informational References 302 [RFC2068] Fielding, R., Gettys, J., Mogul, J., Nielsen, H., and T. 303 Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", 304 RFC 2068, January 1997. 306 Author's Address 308 James M Snell 310 Email: jasnell@gmail.com