idnits 2.17.1 draft-snell-http-prefer-08.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 seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (December 19, 2011) is 4511 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p1-messaging-17 == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p2-semantics-17 == Outdated reference: A later version (-20) exists of draft-ietf-httpbis-p3-payload-17 == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p4-conditional-17 == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p5-range-17 == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p6-cache-17 == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p7-auth-17 ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) Summary: 1 error (**), 0 flaws (~~), 9 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group J. Snell 3 Internet-Draft December 19, 2011 4 Intended status: Informational 5 Expires: June 21, 2012 7 Prefer Header for HTTP 8 draft-snell-http-prefer-08 10 Abstract 12 This specification defines an HTTP header field that can be used by a 13 client to request that certain behaviors be implemented by a server 14 while processing a request. 16 Status of this Memo 18 This Internet-Draft is submitted to IETF in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF). Note that other groups may also distribute 23 working documents as Internet-Drafts. The list of current Internet- 24 Drafts is at http://datatracker.ietf.org/drafts/current/. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 This Internet-Draft will expire on June 21, 2012. 33 Copyright Notice 35 Copyright (c) 2011 IETF Trust and the persons identified as the 36 document authors. All rights reserved. 38 This document is subject to BCP 78 and the IETF Trust's Legal 39 Provisions Relating to IETF Documents 40 (http://trustee.ietf.org/license-info) in effect on the date of 41 publication of this document. Please review these documents 42 carefully, as they describe your rights and restrictions with respect 43 to this document. Code Components extracted from this document must 44 include Simplified BSD License text as described in Section 4.e of 45 the Trust Legal Provisions and are provided without warranty as 46 described in the Simplified BSD License. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 51 1.1. Syntax Notation . . . . . . . . . . . . . . . . . . . . . 3 52 2. The Prefer Request Header . . . . . . . . . . . . . . . . . . 3 53 2.1. Content Negotiation and Cache Considerations . . . . . . . 5 54 2.2. Examples . . . . . . . . . . . . . . . . . . . . . . . . . 5 55 3. The "return-asynch" Preference . . . . . . . . . . . . . . . . 5 56 4. The "return-representation" Preference . . . . . . . . . . . . 6 57 5. The "return-minimal" Preference . . . . . . . . . . . . . . . 6 58 6. The "wait" Preference . . . . . . . . . . . . . . . . . . . . 7 59 7. The "strict" and "lenient" Processing Preferences . . . . . . 8 60 8. Registered Preferences . . . . . . . . . . . . . . . . . . . . 8 61 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 62 9.1. The Registry of Preferences . . . . . . . . . . . . . . . 9 63 9.1.1. Initial Registry Contents . . . . . . . . . . . . . . 10 64 10. Security Considerations . . . . . . . . . . . . . . . . . . . 11 65 11. Normative References . . . . . . . . . . . . . . . . . . . . . 11 66 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 12 68 1. Introduction 70 This specification defines a new HTTP request header field that may 71 be used by clients to request optional behaviors be applied by a 72 server during the processing the request. 74 In this document, the key words "MUST", "MUST NOT", "REQUIRED", 75 "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", 76 and "OPTIONAL" are to be interpreted as described in [RFC2119]. 78 1.1. Syntax Notation 80 This specification uses the Augmented Backus-Naur Form (ABNF) 81 notation of [RFC5234] and includes, by reference, the "token", 82 "quoted-string", "OWS", "BWS" rules and the #rule extension as 83 defined within Section 1.2 [I-D.ietf-httpbis-p1-messaging]. 85 2. The Prefer Request Header 87 The Prefer request-header field is used to indicate that particular 88 server behaviors are preferred by the client, but not required for 89 successful completion of the request. Prefer is similar in nature to 90 the Expect header field defined by Section 9.3 of 91 [I-D.ietf-httpbis-p2-semantics] with the exception that servers are 92 allowed to ignore stated preferences. 94 Prefer = "Prefer" ":" 1#preference 95 preference = token [ BWS "=" BWS value ] 96 *( OWS ";" [ OWS parameter ] ) 97 parameter = token [ BWS "=" BWS value ] 98 value = token / quoted-string 100 This header field is defined with an extensible syntax to allow for 101 future values included in the Registry of Preferences (Section 9.1)). 102 A server that does not recognize or is unable to comply with 103 particular preference tokens in the Prefer header field of a request 104 MUST ignore those tokens and MUST NOT stop processing or signal an 105 error. 107 A preference token MAY specify a value. Empty, or zero length values 108 on both the preference token and within parameters are equivalent to 109 no value being specified at all. The following, then, are 110 equivalent: 112 Prefer: foo; bar 113 Prefer: foo; bar="" 114 Prefer: foo=""; bar 116 An optional, arbitrary collection of parameters MAY be specified for 117 any preference token. The meaning and application of such parameters 118 is dependent on the definition of each preference token and the 119 server's implementation thereof. 121 If a particular preference token or parameter is specified multiple 122 times, repeated occurrences MUST be ignored without signaling an 123 error or otherwise altering the processing of the request. 125 Comparison of preference token names is case-insensitive while values 126 are case-sensitive regardless of whether token or quoted-string 127 values are used. 129 The Prefer request header field MUST be forwarded by a proxy if the 130 request is forwarded. In various situations, A proxy may determine 131 that it is capable of honoring a preference independently of the 132 server to which the request is directed. For instance, an 133 intervening proxy may be capable of transparently providing 134 asynchronous handling of a request using a 202 Accepted responses 135 independently of the origin server. Such proxies could choose to 136 honor the "return-asynch" preference. Individual preference tokens 137 MAY define their own requirements and restrictions as to whether and 138 how proxies may apply the preference to a request independently of 139 the origin server. 141 As per Section 3.2 of [I-D.ietf-httpbis-p1-messaging], 142 Implementations MUST be capable of supporting either multiple 143 instances of the Prefer header field in a single message as well as 144 multiple preference tokens separated by commas in a single Prefer 145 header, for instance, the following examples are equivalent: 147 Multiple Prefer Header Fields: 149 POST /foo HTTP/1.1 150 Host: example.org 151 Prefer: return-asynch 152 Prefer: wait=100 154 Single Prefer Header Field: 156 # Single Prefer Header Field 157 POST /foo HTTP/1.1 158 Host: example.org 159 Prefer: return-asynch, wait=100 161 2.1. Content Negotiation and Cache Considerations 163 Note that while the Prefer header field is not intended to be used as 164 content negotiation mechanism, the application of a preference 165 potentially could affect the caching characteristics of a response. 166 Specifically, if a server supports the optional application of a 167 preference that could even potentially result in a variance to a 168 cache's handling of a response entity, a Vary header field MUST be 169 included with the response listing the Prefer header field regardless 170 of whether the client actually uses Prefer in the request. 172 Because of the inherent complexities involved with properly 173 implementing server-driven content negotiation, effective caching, 174 and the application of optional preferences, implementors must 175 exercise caution when utilizing preferences in such a way as to 176 impact the caching of a response and SHOULD avoid using the Prefer 177 header mechanism for content negotiation. 179 2.2. Examples 181 The following examples illustrate the use of various Preferences 182 defined by this specification, as well as undefined extensions for 183 strictly illustrative purposes: 185 Return a 202 Accepted response for asynchronous processing if the 186 response cannot be processed within 10 seconds. An undefined 187 "priority" preference is also specified. 189 Prefer: return-asynch, wait=10; 190 Prefer: priority=5; 192 Use lenient processing 194 Prefer: Lenient 196 Use of an optional, undefined parameter on the return-minimal 197 preference requesting a response status code of 204 for a successful 198 response. 200 Prefer: return-minimal; status=204 202 3. The "return-asynch" Preference 204 The "return-asynch" preference indicates that the client prefers the 205 server to respond asynchronously to a response. For instance, in the 206 case when the length of time it takes to generate a response will 207 exceed some arbitrary threshold established by the server, the server 208 may honor the return-asynch preference by returning either a 202 209 Accepted or 303 See Other response. 211 return-asynch = "return-asynch" 213 The key motivation for the "return-asynch" preference is to 214 facilitate the operation of asynchronous request handling by allowing 215 the client to indicate to a server it's capability and preference for 216 handling asynchronous responses. 218 4. The "return-representation" Preference 220 The "return-representation" preference indicates that the client 221 prefers that the server include an entity representing the current 222 state of the resource in the response to a successful request. 224 return-representation = "return-representation" 226 When honoring the "return-representation" preference, the server MUST 227 include a Content-Location header field specifying the URI of the 228 resource representation being returned. Per section 6.1 of 229 [I-D.ietf-httpbis-p2-semantics], the presence of the Content-Location 230 header field in the response asserts that the payload is a 231 representation of the resource identified by the Content-Location 232 URI. 234 The "return-representation" preference is intended primarily to 235 provide a means of optimizing communication between the client and 236 server by eliminating the need for a subsequent GET request to 237 retrieve the current representation of the resource following a 238 modification. 240 Currently, after successfully processing a modification request such 241 as a POST or PUT, a server may choose to return either an entity 242 describing the status of the operation or a representation of the 243 modified resource itself. While the selection of which type of 244 entity to return, if any at all, is solely at the discretion of the 245 server, the "return-representation" preference -- along with the 246 "return-minimal" preference defined below -- allow the server to take 247 the client's preferences into consideration while constructing the 248 response. 250 5. The "return-minimal" Preference 252 The "return-minimal" preference indicates that the client wishes the 253 server to return a minimal response to a successful request. 255 Typically, such responses would utilize the 204 No Content status, 256 but other codes MAY be used as appropriate, such as a 200 status with 257 a zero-length response entity. The determination of what constitutes 258 an appropriate minimal response is solely at the discretion of the 259 server. 261 return-minimal = "return-minimal" 263 The "return-minimal" preference is intended to provide a means of 264 optimizing communication between the client and server by reducing 265 the amount of data the server is required to return to the client 266 following a request. This can be particularly useful, for instance, 267 when communicating with limited-bandwidth mobile devices or when the 268 client simply does not require any further information about the 269 result of a request beyond knowing if it was successfully processed. 271 6. The "wait" Preference 273 The "wait" preference can be used to establish an upper bound on the 274 length of time, in seconds, the client is willing to wait for a 275 response, after which the client may choose to abandon the request. 276 In the case generating a response will take longer than the time 277 specified, the server, or proxy, can choose to either return a 202 278 Accepted response, cancel processing, or continue attempting to 279 complete the request. 281 wait = "wait" BWS "=" BWS delta-seconds 283 Clients specifying the "wait" Preference SHOULD also use the Date 284 header field, as specified in Section 9.2 of 285 [I-D.ietf-httpbis-p2-semantics], within the request to establish the 286 time at which the client began waiting for the completion of the 287 request. Failing to include a Date header field in the request would 288 require the server to use the instant it received and began 289 processing the request as the baseline for determining how long the 290 client has been waiting which could yield unintended results 291 depending on how out of synch the client and server clocks are. 293 Note that because of the inherent difficulties in reliably 294 determining the length of time a request will take to arrive at 295 server, the wait preference is, at most, a hint to the server as to 296 what the client is likely to do should the processing of a request 297 take too long. When specifying a value for the wait preference, 298 Client's need to take appropriate care to specify a reasonable period 299 of time. 301 7. The "strict" and "lenient" Processing Preferences 303 The "strict" and "lenient" preferences are mutually-exclusive 304 directives indicating, at the servers discretion, how the client 305 wishes the server to handle potential error conditions that may arise 306 in the processing of a request. For instance, if the payload of a 307 request contains various minor syntactical or semantic errors, but 308 the server is still capable of comprehending and successfully 309 processing the request, a decision must be made to either reject the 310 request with an appropriate 4xx error response or to go ahead with 311 processing. The "strict" preference can be used by the client to 312 indicate that, in such conditions, it would prefer that the server 313 reject the request, while the "lenient" preference indicates that the 314 client would prefer the server to attempt to process the request. 315 The specific meaning and application of the "strict" and "lenient" 316 directives is specific to each type of resource, the request method 317 and the operation of the server. 319 handling = "strict" / "lenient" 321 8. Registered Preferences 323 Well-defined preferences can be registered for convenience and/or to 324 promote reuse by other applications. This specification establishes 325 an IANA registry of such relation types see Section 9.1. 327 Registered preference names MUST conform to the token rule, and MUST 328 be compared character-by-character in a case-insensitive fashion. 329 They SHOULD be appropriate to the specificity of the preference; 330 i.e., if the semantics are highly specific to a particular 331 application, the name should reflect that, so that more general names 332 are available for less specific use. 334 Registered preferences MUST NOT constrain servers, clients or any 335 intermediaries involved in the exchange and processing of a request 336 to any behavior required for successful processing. The use and 337 application of a preference within a given request MUST be optional 338 on the part of all participants. 340 9. IANA Considerations 342 The 'Prefer' header field should be added to the permanent registry 343 (see [RFC3864]). 345 Header field name: Prefer 346 Applicable Protocol: HTTP 347 Status: 348 Author: James M Snell 349 Change controller: IETF 350 Specification document: this specification 352 9.1. The Registry of Preferences 354 Preferences are registered on the advice of a Designated Expert 355 (appointed by the IESG or their delegate), with a Specification 356 Required (using terminology from [RFC5226]). 358 The requirements for registered preferences are described in 359 Section 8. 361 Registration requests consist of the completed registration template 362 below, typically published in an RFC or Open Standard (in the sense 363 described by Section 7 of [RFC2026]). However, to allow for the 364 allocation of values prior to publication, the Designated Expert may 365 approve registration once they are satisfied that a specification 366 will be published. 368 Note that relation types can be registered by third parties, if the 369 Designated Expert determines that an unregistered relation type is 370 widely deployed and not likely to be registered in a timely manner. 372 The registration template is: 374 o Preference: (A value for the Prefer request header field that 375 conforms to the syntax rule given in Section 2) 376 o Description: 377 o Reference: 378 o Notes: [optional] 379 o Application Data: [optional] 381 Registration requests should be sent to the preferences@ietf.org 382 mailing list, marked clearly in the subject line (e.g., "NEW 383 PREFERENCE - example" to register an "example" preference). 385 Within at most 14 days of the request, the Designated Expert(s) will 386 either approve or deny the registration request, communicating this 387 decision to the review list and IANA. Denials should include an 388 explanation and, if applicable, suggestions as to how to make the 389 request successful. 391 Decisions (or lack thereof) made by the Designated Expert can be 392 first appealed to Application Area Directors (contactable using 393 app-ads@tools.ietf.org email address or directly by looking up their 394 email addresses on http://www.iesg.org/ website) and, if the 395 appellant is not satisfied with the response, to the full IESG (using 396 the iesg@iesg.org mailing list). 398 IANA should only accept registry updates from the Designated 399 Expert(s), and should direct all requests for registration to the 400 review mailing list. 402 9.1.1. Initial Registry Contents 404 The Preferences Registry's initial contents are: 406 o Preference: return-asynch 407 o Description: Indicates that the client prefers the server to 408 respond asynchronously to a request as described by Section 3 409 o Reference: [this specification] 411 o Preference: return-minimal 412 o Description: Indicates that the client prefers the server return a 413 minimal response to a request as described by Section 5 414 o Reference: [this specification] 416 o Preference: return-representation 417 o Description: Indicates that the client prefers the server to 418 include a representation of the current state of the resource in 419 response to a request as described by Section 4 420 o Reference: [this specification] 422 o Preference: wait 423 o Description: Indicates an upper bound to the lenght of time the 424 client is willing to wait for a response, after which the request 425 may be aborted. 426 o Reference: [this specification] 428 o Preference: strict 429 o Description: Indicates that the client wishes the server to apply 430 strict validation and error handling to the processing of a 431 request. 432 o Reference: [this specification] 434 o Preference: lenient 435 o Description: Indicates that the client wishes the server to apply 436 lenient validation and error handling to the processing of a 437 request. 438 o Reference: [this specification] 440 10. Security Considerations 442 Specific preferences requested by a client can introduce security 443 considerations and concerns beyond those discussed in HTTP/1.1 Parts 444 1 [I-D.ietf-httpbis-p1-messaging], 2 [I-D.ietf-httpbis-p2-semantics], 445 3 [I-D.ietf-httpbis-p3-payload], 4 [I-D.ietf-httpbis-p4-conditional], 446 5 [I-D.ietf-httpbis-p5-range], 6 [I-D.ietf-httpbis-p6-cache], and 7 447 [I-D.ietf-httpbis-p7-auth]. Implementors must refer to the 448 specifications and descriptions of each preference to determine the 449 security considerations relevant to each. 451 11. Normative References 453 [I-D.ietf-httpbis-p1-messaging] 454 Fielding, R., Gettys, J., Mogul, J., Nielsen, H., 455 Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., and 456 J. Reschke, "HTTP/1.1, part 1: URIs, Connections, and 457 Message Parsing", draft-ietf-httpbis-p1-messaging-17 (work 458 in progress), October 2011. 460 [I-D.ietf-httpbis-p2-semantics] 461 Fielding, R., Gettys, J., Mogul, J., Nielsen, H., 462 Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., and 463 J. Reschke, "HTTP/1.1, part 2: Message Semantics", 464 draft-ietf-httpbis-p2-semantics-17 (work in progress), 465 October 2011. 467 [I-D.ietf-httpbis-p3-payload] 468 Fielding, R., Gettys, J., Mogul, J., Nielsen, H., 469 Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., and 470 J. Reschke, "HTTP/1.1, part 3: Message Payload and Content 471 Negotiation", draft-ietf-httpbis-p3-payload-17 (work in 472 progress), October 2011. 474 [I-D.ietf-httpbis-p4-conditional] 475 Fielding, R., Gettys, J., Mogul, J., Nielsen, H., 476 Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., and 477 J. Reschke, "HTTP/1.1, part 4: Conditional Requests", 478 draft-ietf-httpbis-p4-conditional-17 (work in progress), 479 October 2011. 481 [I-D.ietf-httpbis-p5-range] 482 Fielding, R., Gettys, J., Mogul, J., Nielsen, H., 483 Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., and 484 J. Reschke, "HTTP/1.1, part 5: Range Requests and Partial 485 Responses", draft-ietf-httpbis-p5-range-17 (work in 486 progress), October 2011. 488 [I-D.ietf-httpbis-p6-cache] 489 Fielding, R., Gettys, J., Mogul, J., Nielsen, H., 490 Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., 491 Nottingham, M., and J. Reschke, "HTTP/1.1, part 6: 492 Caching", draft-ietf-httpbis-p6-cache-17 (work in 493 progress), October 2011. 495 [I-D.ietf-httpbis-p7-auth] 496 Fielding, R., Gettys, J., Mogul, J., Nielsen, H., 497 Masinter, L., Leach, P., Berners-Lee, T., Lafon, Y., and 498 J. Reschke, "HTTP/1.1, part 7: Authentication", 499 draft-ietf-httpbis-p7-auth-17 (work in progress), 500 October 2011. 502 [RFC2026] Bradner, S., "The Internet Standards Process -- Revision 503 3", BCP 9, RFC 2026, October 1996. 505 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 506 Requirement Levels", BCP 14, RFC 2119, March 1997. 508 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 509 Procedures for Message Header Fields", BCP 90, RFC 3864, 510 September 2004. 512 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 513 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 514 May 2008. 516 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 517 Specifications: ABNF", STD 68, RFC 5234, January 2008. 519 Author's Address 521 James M Snell 523 Email: jasnell@gmail.com