Beruflich Dokumente
Kultur Dokumente
Abstract
Copyright Notice
Copyright (c) 2014 IETF Trust and the persons identified as the
document authors. All rights reserved.
Table of Contents
1. Introduction ....................................................2
1.1. Syntax Notation ............................................4
2. The Prefer Request Header Field .................................4
2.1. Examples ...................................................6
3. The Preference-Applied Response Header Field ....................7
4. Preference Definitions ..........................................8
4.1. The "respond-async" Preference .............................8
4.2. The "return=representation" and "return=minimal"
Preferences ................................................9
4.3. The "wait" Preference .....................................11
4.4. The "handling=strict" and "handling=lenient" Processing ...12
5. IANA Considerations ............................................13
5.1. The Registry of Preferences ...............................13
5.2. Initial Registry Contents .................................15
6. Security Considerations ........................................16
7. References .....................................................16
7.1. Normative References ......................................16
7.2. Informative References ....................................16
1. Introduction
For example, when using the HTTP PUT method to modify a resource --
similar to that defined for the Atom Publishing Protocol [RFC5023] --
the server is given the option of returning either a complete
representation of a modified resource or a minimal response that
indicates only the successful completion of the operation. The
selection of which type of response to return to the client generally
has no bearing on the successful processing of the request but could,
for instance, have an impact on what actions the client must take
after receiving the response. That is, returning a representation of
the modified resource within the response can allow the client to
avoid sending an additional subsequent GET request.
https://tools.ietf.org/html/rfc7240 2/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
https://tools.ietf.org/html/rfc7240 3/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
ABNF:
https://tools.ietf.org/html/rfc7240 4/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
https://tools.ietf.org/html/rfc7240 5/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
2.1. Examples
{...}
https://tools.ietf.org/html/rfc7240 6/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
{...}
{...}
ABNF:
https://tools.ietf.org/html/rfc7240 7/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
Request:
Response:
HTTP/1.1 200 OK
Content-Type: application/json
Preference-Applied: return=representation
Content-Location: /my-document
{"a": 1}
4. Preference Definitions
ABNF:
respond-async = "respond-async"
https://tools.ietf.org/html/rfc7240 8/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
{Data}
ABNF:
https://tools.ietf.org/html/rfc7240 9/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
1c1
< ABCDEFGHIJKLMNOPQRSTUVWXYZ
---
> BCDFGHJKLMNPQRSTVWXYZ
HTTP/1.1 200 OK
Content-Location: http://example.org/item/123
Content-Type: text/plain
ETag: "d3b07384d113edec49eaa6238ad5ff00"
BCDFGHJKLMNPQRSTVWXYZ
https://tools.ietf.org/html/rfc7240 10/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
{Data}
ABNF:
https://tools.ietf.org/html/rfc7240 11/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
{Data}
ABNF:
https://tools.ietf.org/html/rfc7240 12/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
5. IANA Considerations
Status: Standard
Status: Standard
https://tools.ietf.org/html/rfc7240 13/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
o Description:
o Reference:
o Notes: [optional]
The "Value" and "Optional Parameters" fields MAY be omitted from the
registration template if the specific preference token definition
does not define either.
https://tools.ietf.org/html/rfc7240 14/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
o Preference: respond-async
o Preference: return
o Preference: wait
o Preference: handling
https://tools.ietf.org/html/rfc7240 15/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
6. Security Considerations
7. References
https://tools.ietf.org/html/rfc7240 16/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
Author's Address
James M Snell
EMail: jasnell@gmail.com
https://tools.ietf.org/html/rfc7240 17/18
10/25/2017 RFC 7240 - Prefer Header for HTTP
https://tools.ietf.org/html/rfc7240 18/18