| < draft-nottingham-json-home-00.txt | draft-nottingham-json-home-01.txt > | |||
|---|---|---|---|---|
| Network Working Group M. Nottingham | Network Working Group M. Nottingham | |||
| Internet-Draft Rackspace | Internet-Draft Rackspace | |||
| Intended status: Informational May 9, 2012 | Intended status: Informational July 5, 2012 | |||
| Expires: November 10, 2012 | Expires: January 6, 2013 | |||
| Home Documents for HTTP APIs | Home Documents for HTTP APIs | |||
| draft-nottingham-json-home-00 | draft-nottingham-json-home-01 | |||
| Abstract | Abstract | |||
| This document proposes a "home document" format for non-browser HTTP | This document proposes a "home document" format for non-browser HTTP | |||
| clients. | clients. | |||
| Status of this Memo | Status of this Memo | |||
| This Internet-Draft is submitted in full conformance with the | This Internet-Draft is submitted in full conformance with the | |||
| provisions of BCP 78 and BCP 79. | provisions of BCP 78 and BCP 79. | |||
| skipping to change at page 1, line 31 ¶ | skipping to change at page 1, line 31 ¶ | |||
| Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
| Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
| working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
| Drafts is at http://datatracker.ietf.org/drafts/current/. | Drafts is at http://datatracker.ietf.org/drafts/current/. | |||
| Internet-Drafts are draft documents valid for a maximum of six months | Internet-Drafts are draft documents valid for a maximum of six months | |||
| and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
| time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
| material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
| This Internet-Draft will expire on November 10, 2012. | This Internet-Draft will expire on January 6, 2013. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2012 IETF Trust and the persons identified as the | Copyright (c) 2012 IETF Trust and the persons identified as the | |||
| document authors. All rights reserved. | document authors. All rights reserved. | |||
| This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
| Provisions Relating to IETF Documents | Provisions Relating to IETF Documents | |||
| (http://trustee.ietf.org/license-info) in effect on the date of | (http://trustee.ietf.org/license-info) in effect on the date of | |||
| publication of this document. Please review these documents | publication of this document. Please review these documents | |||
| skipping to change at page 2, line 17 ¶ | skipping to change at page 2, line 17 ¶ | |||
| 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 | |||
| 2. Requirements . . . . . . . . . . . . . . . . . . . . . . . . . 3 | 2. Requirements . . . . . . . . . . . . . . . . . . . . . . . . . 3 | |||
| 3. JSON Home Documents . . . . . . . . . . . . . . . . . . . . . 3 | 3. JSON Home Documents . . . . . . . . . . . . . . . . . . . . . 3 | |||
| 4. Resource Objects . . . . . . . . . . . . . . . . . . . . . . . 5 | 4. Resource Objects . . . . . . . . . . . . . . . . . . . . . . . 5 | |||
| 4.1. Resolving Templated Links . . . . . . . . . . . . . . . . 5 | 4.1. Resolving Templated Links . . . . . . . . . . . . . . . . 5 | |||
| 5. Resource Hints . . . . . . . . . . . . . . . . . . . . . . . . 6 | 5. Resource Hints . . . . . . . . . . . . . . . . . . . . . . . . 6 | |||
| 5.1. allow . . . . . . . . . . . . . . . . . . . . . . . . . . 7 | 5.1. allow . . . . . . . . . . . . . . . . . . . . . . . . . . 7 | |||
| 5.2. representations . . . . . . . . . . . . . . . . . . . . . 7 | 5.2. representations . . . . . . . . . . . . . . . . . . . . . 7 | |||
| 5.3. accept-patch . . . . . . . . . . . . . . . . . . . . . . . 7 | 5.3. accept-patch . . . . . . . . . . . . . . . . . . . . . . . 7 | |||
| 5.4. accept-post . . . . . . . . . . . . . . . . . . . . . . . 7 | 5.4. accept-post . . . . . . . . . . . . . . . . . . . . . . . 7 | |||
| 5.5. accept-ranges . . . . . . . . . . . . . . . . . . . . . . 7 | 5.5. accept-put . . . . . . . . . . . . . . . . . . . . . . . . 7 | |||
| 6. Creating and Serving Home Documents . . . . . . . . . . . . . 7 | 5.6. accept-ranges . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 6.1. Managing Change in Home Documents . . . . . . . . . . . . 8 | 5.7. prefer . . . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 6.2. Evolving and Mixing APIs with Home Documents . . . . . . . 8 | 5.8. docs . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 6.3. Documenting APIs that use Home Documents . . . . . . . . . 8 | 5.9. precondition-req . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 7. Consuming Home Documents . . . . . . . . . . . . . . . . . . . 9 | 5.10. status . . . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 8. Security Considerations . . . . . . . . . . . . . . . . . . . 9 | 6. Creating and Serving Home Documents . . . . . . . . . . . . . 8 | |||
| 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 | 6.1. Managing Change in Home Documents . . . . . . . . . . . . 9 | |||
| 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 9 | 6.2. Evolving and Mixing APIs with Home Documents . . . . . . . 9 | |||
| 10.1. Normative References . . . . . . . . . . . . . . . . . . . 9 | 6.3. Documenting APIs that use Home Documents . . . . . . . . . 10 | |||
| 10.2. Informative References . . . . . . . . . . . . . . . . . . 10 | 7. Consuming Home Documents . . . . . . . . . . . . . . . . . . . 10 | |||
| Appendix A. Frequently Asked Questions . . . . . . . . . . . . . 10 | 8. Security Considerations . . . . . . . . . . . . . . . . . . . 10 | |||
| A.1. Why not Microformats? . . . . . . . . . . . . . . . . . . 10 | 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 | |||
| A.2. What about authentication? . . . . . . . . . . . . . . . . 11 | 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 11 | |||
| A.3. What about "Faults" (i.e., errors)? . . . . . . . . . . . 11 | 10.1. Normative References . . . . . . . . . . . . . . . . . . . 11 | |||
| A.4. How Do I find the XML Schema / JSON Schema / etc. for | 10.2. Informative References . . . . . . . . . . . . . . . . . . 11 | |||
| a particular media type? . . . . . . . . . . . . . . . . . 11 | Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 12 | |||
| Appendix B. Open Issues . . . . . . . . . . . . . . . . . . . . . 11 | Appendix B. Frequently Asked Questions . . . . . . . . . . . . . 12 | |||
| Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 12 | B.1. Why not Microformats? . . . . . . . . . . . . . . . . . . 12 | |||
| B.2. What about authentication? . . . . . . . . . . . . . . . . 12 | ||||
| B.3. What about 'Faults' (i.e., errors)? . . . . . . . . . . . 12 | ||||
| B.4. How Do I find the XML Schema / JSON Schema / etc. for | ||||
| a particular media type? . . . . . . . . . . . . . . . . . 13 | ||||
| Appendix C. Open Issues . . . . . . . . . . . . . . . . . . . . . 13 | ||||
| Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 13 | ||||
| 1. Introduction | 1. Introduction | |||
| There is an emerging preference for non-browser Web applications | There is an emerging preference for non-browser Web applications | |||
| (colloquially, "HTTP APIs") to use a link-driven approach to their | (colloquially, "HTTP APIs") to use a link-driven approach to their | |||
| interactions to assure loose coupling, thereby enabling extensibility | interactions to assure loose coupling, thereby enabling extensibility | |||
| and API evolution. | and API evolution. | |||
| This is based upon experience with previous APIs which specified | This is based upon experience with previous APIs that specified | |||
| static URI paths (such as | static URI paths (such as | |||
| "http://api.example.com/v1.0/widgets/abc123/properties") have | "http://api.example.com/v1.0/widgets/abc123/properties") have | |||
| resulted in brittle, tight coupling between clients and servers. | resulted in brittle, tight coupling between clients and servers. | |||
| Sometimes, these APIs are documented by a document format like | Sometimes, these APIs were documented by a document format like | |||
| WADL [1] that is used as a "design-time" description; i.e., the URIs | WADL [1] that is used as a design time description; i.e., the URIs | |||
| and other information they describe are "baked into" client | and other information they describe are "baked into" client | |||
| implementations. | implementations. | |||
| In contrast, a "follow your nose" API advertises the resources | In contrast, a "follow your nose" API advertises the resources | |||
| available to clients using link relations [RFC5988] and the formats | available to clients using link relations [RFC5988] and the formats | |||
| they support using internet media types [RFC4288]. A client can then | they support using internet media types [RFC4288]. A client can then | |||
| decide - at "run time" - which resources to interact with based upon | decide - at run time - which resources to interact with based upon | |||
| its capabilities (as described by link relations), and the server can | its capabilities (as described by link relations), and the server can | |||
| safely add new resources and formats without disturbing clients that | safely add new resources and formats without disturbing clients that | |||
| are not yet aware of them. | are not yet aware of them. | |||
| As such, the client needs to be able to discover this information | As such, the client needs to be able to discover this information | |||
| quickly and efficiently use it to interact with the server. Just as | quickly and efficiently use it to interact with the server. Just as | |||
| with a human-targeted "home page" for a site, we can create a "home | with a human-targeted home page for a site, we can create a "home | |||
| document" for a HTTP API (often, at the same URI, found through | document" for a HTTP API that describes it to non-browser clients. | |||
| server-driven content negotiation) that describes it to non-browser | ||||
| clients. | ||||
| Of course, an HTTP API might use any format to do so; however, there | Of course, an HTTP API might use any format to do so; however, there | |||
| are advantages to having a standard home document format. This | are advantages to having a standard home document format. This | |||
| specification suggests one for consideration, using the JSON format | specification suggests one for consideration, using the JSON format | |||
| [RFC4627]. | [RFC4627]. | |||
| 2. Requirements | 2. Requirements | |||
| The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | |||
| "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this | "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this | |||
| skipping to change at page 4, line 42 ¶ | skipping to change at page 4, line 41 ¶ | |||
| "allow": ["GET", "PUT", "DELETE", "PATCH"], | "allow": ["GET", "PUT", "DELETE", "PATCH"], | |||
| "representations": ["application/json"], | "representations": ["application/json"], | |||
| "accept-patch": ["application/json-patch"], | "accept-patch": ["application/json-patch"], | |||
| "accept-post": ["application/xml"], | "accept-post": ["application/xml"], | |||
| "accept-ranges": ["bytes"] | "accept-ranges": ["bytes"] | |||
| } | } | |||
| } | } | |||
| } | } | |||
| } | } | |||
| Here, we have a home document that links two a resource, "/widgets/" | Here, we have a home document that links to a resource, "/widgets/" | |||
| with the relation "http://example.org/rel/widgets", and also links to | with the relation "http://example.org/rel/widgets". It also links to | |||
| one or more with the relation type "http://example.org/rel/widget" | an undefined number of resources with the relation type | |||
| using a URI Template [RFC6570]. | "http://example.org/rel/widget" using a URI Template [RFC6570], along | |||
| with a mapping of several identifiers to specific variables for use | ||||
| in that template. | ||||
| It also gives several hints about interacting with the latter | It also gives several hints about interacting with the latter | |||
| "widget" resources, including the HTTP methods usable with them, the | "widget" resources, including the HTTP methods usable with them, the | |||
| patch formats they accept, and the fact that they support partial | patch formats they accept, and the fact that they support partial | |||
| requests [RFC2616] using the "bytes" range-specifier. | requests [I-D.ietf-httpbis-p5-range] using the "bytes" range- | |||
| specifier. | ||||
| It gives no such hints about the "widgets" resource. This does not | It gives no such hints about the "widgets" resource. This does not | |||
| mean that it (for example) doesn't support any HTTP methods; it means | mean that it (for example) doesn't support any HTTP methods; it means | |||
| that the client will need to discover this by interacting with the | that the client will need to discover this by interacting with the | |||
| resource, and/or examining the documentation for its link relation | resource, and/or examining the documentation for its link relation | |||
| type. | type. | |||
| 4. Resource Objects | 4. Resource Objects | |||
| A Resource Object links to resources of the defined type using one of | A Resource Object links to resources of the defined type using one of | |||
| two mechanisms; either a direct link (in which case there is exactly | two mechanisms; either a direct link (in which case there is exactly | |||
| one resource of that relation type associated with the API), or a | one resource of that relation type associated with the API), or a | |||
| templated link, in which case there are zero to many such resources. | templated link, in which case there are zero to many such resources. | |||
| Resource Objects MUST have only and exactly one of the "href" and | ||||
| "href-template" properties. | ||||
| Direct links are indicated with an "href" property, whose value is a | Direct links are indicated with an "href" property, whose value is a | |||
| URI [RFC3986]. | URI [RFC3986]. | |||
| Templated links are indicated with an "href-template" property, whose | Templated links are indicated with an "href-template" property, whose | |||
| value is a URI Template [RFC6570]. When "href-template" is present, | value is a URI Template [RFC6570]. When "href-template" is present, | |||
| the Resource Object MUST have a "href-vars" property; see "Resolving | the Resource Object MUST have a "href-vars" property; see "Resolving | |||
| Templated Links". | Templated Links". | |||
| Resource Objects MUST have exactly one of the "href" and "href-vars" | ||||
| properties. | ||||
| In both forms, the links that "href" and "href-template" refer to are | In both forms, the links that "href" and "href-template" refer to are | |||
| URI-references [RFC3986] whose base URI is that of the JSON Home | URI-references [RFC3986] whose base URI is that of the JSON Home | |||
| Document itself. | Document itself. | |||
| Resource Objects MAY also have a "hints" property, whose value is an | Resource Objects MAY also have a "hints" property, whose value is an | |||
| object that uses named Resource Hints as its properties. | object that uses named Resource Hints as its properties. | |||
| 4.1. Resolving Templated Links | 4.1. Resolving Templated Links | |||
| A URI can be derived from a Templated Link by treating the "href- | A URI can be derived from a Templated Link by treating the "href- | |||
| skipping to change at page 6, line 38 ¶ | skipping to change at page 6, line 38 ¶ | |||
| Resource hints allow clients to find relevant information about | Resource hints allow clients to find relevant information about | |||
| interacting with a resource beforehand, as a means of optimising | interacting with a resource beforehand, as a means of optimising | |||
| communications, as well as advertising available behaviours (e.g., to | communications, as well as advertising available behaviours (e.g., to | |||
| aid in laying out a user interface for consuming the API). | aid in laying out a user interface for consuming the API). | |||
| Hints are just that - they are not a "contract", and are to only be | Hints are just that - they are not a "contract", and are to only be | |||
| taken as advisory. The runtime behaviour of the resource always | taken as advisory. The runtime behaviour of the resource always | |||
| overrides hinted information. | overrides hinted information. | |||
| For example, a resource might hint that the PUT method is allowed on | For example, a resource might hint that the PUT method is allowed on | |||
| all "widget" resources. this means that generally, the user has the | all "widget" resources. This means that generally, the user has the | |||
| ability to PUT to a particular resource, but a specific resource may | ability to PUT to a particular resource, but a specific resource | |||
| reject a PUT based upon access control or other considerations. More | could reject a PUT based upon access control or other considerations. | |||
| fine-grained information might be gathered by interacting with the | More fine-grained information might be gathered by interacting with | |||
| resource (e.g., via a GET), or by another resource "containing" it | the resource (e.g., via a GET), or by another resource "containing" | |||
| (such as a "widgets" collection). | it (such as a "widgets" collection). | |||
| This specification defines a set of common hints, based upon | This specification defines a set of common hints, based upon | |||
| information that's discoverable by directly interacting with | information that's discoverable by directly interacting with | |||
| resources. A future draft will explain how to define new hints. | resources. A future draft will explain how to define new hints. | |||
| 5.1. allow | 5.1. allow | |||
| Hints the HTTP methods that the current client will be able to use to | Hints the HTTP methods that the current client will be able to use to | |||
| interact with the resource; equivalent to the Allow HTTP response | interact with the resource; equivalent to the Allow HTTP response | |||
| header. | header. | |||
| skipping to change at page 7, line 23 ¶ | skipping to change at page 7, line 23 ¶ | |||
| 5.2. representations | 5.2. representations | |||
| Hints the representation types that the resource produces and | Hints the representation types that the resource produces and | |||
| consumes, using the GET and PUT methods respectively, subject to the | consumes, using the GET and PUT methods respectively, subject to the | |||
| 'allow' hint. | 'allow' hint. | |||
| Content MUST be an array of strings, containing media types. | Content MUST be an array of strings, containing media types. | |||
| 5.3. accept-patch | 5.3. accept-patch | |||
| Hints the PATCH request formats accepted by the resource for this | Hints the PATCH request formats [RFC5789] accepted by the resource | |||
| client; equivalent to the Accept-Patch HTTP response header. | for this client; equivalent to the Accept-Patch HTTP response header. | |||
| Content MUST be an array of strings, containing media types. | Content MUST be an array of strings, containing media types. | |||
| When this hint is present, "PATCH" SHOULD be listed in the "allow" | ||||
| hint. | ||||
| 5.4. accept-post | 5.4. accept-post | |||
| Hints the POST request formats accepted by the resource for this | Hints the POST request formats accepted by the resource for this | |||
| client. | client. | |||
| Content MUST be an array of strings, containing media types. | Content MUST be an array of strings, containing media types. | |||
| 5.5. accept-ranges | When this hint is present, "POST" SHOULD be listed in the "allow" | |||
| hint. | ||||
| 5.5. accept-put | ||||
| Hints the PUT request formats accepted by the resource for this | ||||
| client. | ||||
| Content MUST be an array of strings, containing media types. If | ||||
| absent, a client MAY assume that any format indicated by the | ||||
| 'representations' hint is acceptable in a PUT. | ||||
| When this hint is present, "PUT" SHOULD be listed in the "allow" | ||||
| hint. | ||||
| 5.6. accept-ranges | ||||
| Hints the range-specifiers available to the client for this resource; | Hints the range-specifiers available to the client for this resource; | |||
| equivalent to the Accept-Ranges HTTP response header. | equivalent to the Accept-Ranges HTTP response header | |||
| [I-D.ietf-httpbis-p5-range]. | ||||
| Content MUST be an array of strings, containing HTTP range- | Content MUST be an array of strings, containing HTTP range- | |||
| specifiers. | specifiers. | |||
| 5.7. prefer | ||||
| Hints the preferences [I-D.snell-http-prefer] supported by the | ||||
| resource. Note that, as per that specifications, a preference can be | ||||
| ignored by the server. | ||||
| Content MUST be an array of strings, contain preferences. | ||||
| 5.8. docs | ||||
| Hints the location for human-readable documentation for the relation | ||||
| type of the resource. | ||||
| Content MUST be a string containing an absolute-URI [RFC3986] | ||||
| referring to documentation that SHOULD be in HTML format. | ||||
| 5.9. precondition-req | ||||
| Hints that the resource requires state-changing requests (e.g., PUT, | ||||
| PATCH) to include a precondition, as per | ||||
| [I-D.ietf-httpbis-p4-conditional], to avoid conflicts due to | ||||
| concurrent updates. | ||||
| Content MUST be an array of strings, with possible values "etag" and | ||||
| "last-modified" indicating type type of precondition expected. | ||||
| 5.10. status | ||||
| Hints the status of the resource. | ||||
| Content MUST be a string; possible values are: | ||||
| o "deprecated" - indicates that use of the resource is not | ||||
| recommended, but it can still be used. | ||||
| 6. Creating and Serving Home Documents | 6. Creating and Serving Home Documents | |||
| When making a home document available, there are a few things to keep | When making a home document available, there are a few things to keep | |||
| in mind: | in mind: | |||
| o A home document is best located at a memorable URI, because its | o A home document is best located at a memorable URI, because its | |||
| URI will effectively become the URI for the API itself to clients. | URI will effectively become the URI for the API itself to clients. | |||
| o Home documents can be personalised, just as "normal" home pages | o Home documents can be personalised, just as "normal" home pages | |||
| can. For example, you might advertise different URIs, and/or | can. For example, you might advertise different URIs, and/or | |||
| different kinds of link relations, depending on the client's | different kinds of link relations, depending on the client's | |||
| identity. | identity. | |||
| o Home documents SHOULD be assigned a freshness lifetime (e.g., | o Home documents SHOULD be assigned a freshness lifetime (e.g., | |||
| "Cache-Control: max-age=3600") so that clients can cache them, to | "Cache-Control: max-age=3600") so that clients can cache them, to | |||
| avoid having to fetch it every time the client interacts with the | avoid having to fetch it every time the client interacts with the | |||
| service. | service. | |||
| o Custom link relation types, as well as the URIs for variables, | o Custom link relation types, as well as the URIs for variables, | |||
| should lead to documentation for those constructs. | should lead to documentation for those constructs. | |||
| skipping to change at page 9, line 24 ¶ | skipping to change at page 10, line 29 ¶ | |||
| will scan the Resources Object for the link relation(s) that it is | will scan the Resources Object for the link relation(s) that it is | |||
| interested in, and then to interact with the resource(s) referred to. | interested in, and then to interact with the resource(s) referred to. | |||
| Resource Hints can be used to optimise communication with the client, | Resource Hints can be used to optimise communication with the client, | |||
| as well as to inform as to the permissible actions (e.g., whether PUT | as well as to inform as to the permissible actions (e.g., whether PUT | |||
| is likely to be supported). | is likely to be supported). | |||
| Note that the home document is a "living" document; it does not | Note that the home document is a "living" document; it does not | |||
| represent a "contract", but rather is expected to be inspected before | represent a "contract", but rather is expected to be inspected before | |||
| each interaction. In particular, links from the home document MUST | each interaction. In particular, links from the home document MUST | |||
| NOT be assumed to be valid beyond the freshness lifetime of the home | NOT be assumed to be valid beyond the freshness lifetime of the home | |||
| document, as per HTTP's caching model [RFC2616]. | document, as per HTTP's caching model [I-D.ietf-httpbis-p6-cache]. | |||
| As a result, clients SHOULD cache the home document (as per | As a result, clients SHOULD cache the home document (as per | |||
| [RFC2616], to avoid fetching it before every interaction (which would | [I-D.ietf-httpbis-p6-cache]), to avoid fetching it before every | |||
| otherwise be required). | interaction (which would otherwise be required). | |||
| Likewise, a client encountering a 404 Not Found on a link SHOULD | Likewise, a client encountering a 404 Not Found on a link SHOULD | |||
| obtain a fresh copy of the home document, to assure that it is up-to- | obtain a fresh copy of the home document, to assure that it is up-to- | |||
| date. | date. | |||
| 8. Security Considerations | 8. Security Considerations | |||
| TBD | TBD | |||
| 9. IANA Considerations | 9. IANA Considerations | |||
| skipping to change at page 9, line 43 ¶ | skipping to change at page 11, line 4 ¶ | |||
| 8. Security Considerations | 8. Security Considerations | |||
| TBD | TBD | |||
| 9. IANA Considerations | 9. IANA Considerations | |||
| TBD | TBD | |||
| 10. References | 10. References | |||
| 10.1. Normative References | 10.1. Normative References | |||
| [I-D.ietf-httpbis-p6-cache] | ||||
| Fielding, R., Lafon, Y., Nottingham, M., and J. Reschke, | ||||
| "HTTP/1.1, part 6: Caching", | ||||
| draft-ietf-httpbis-p6-cache-19 (work in progress), | ||||
| March 2012. | ||||
| [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate | |||
| Requirement Levels", BCP 14, RFC 2119, March 1997. | Requirement Levels", BCP 14, RFC 2119, March 1997. | |||
| [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., | ||||
| Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext | ||||
| Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. | ||||
| [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform | [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform | |||
| Resource Identifier (URI): Generic Syntax", STD 66, | Resource Identifier (URI): Generic Syntax", STD 66, | |||
| RFC 3986, January 2005. | RFC 3986, January 2005. | |||
| [RFC4627] Crockford, D., "The application/json Media Type for | [RFC4627] Crockford, D., "The application/json Media Type for | |||
| JavaScript Object Notation (JSON)", RFC 4627, July 2006. | JavaScript Object Notation (JSON)", RFC 4627, July 2006. | |||
| [RFC5988] Nottingham, M., "Web Linking", RFC 5988, October 2010. | [RFC5988] Nottingham, M., "Web Linking", RFC 5988, October 2010. | |||
| [RFC6570] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., | [RFC6570] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., | |||
| and D. Orchard, "URI Template", RFC 6570, March 2012. | and D. Orchard, "URI Template", RFC 6570, March 2012. | |||
| 10.2. Informative References | 10.2. Informative References | |||
| [I-D.ietf-httpbis-p4-conditional] | ||||
| Fielding, R., Lafon, Y., and J. Reschke, "HTTP/1.1, part | ||||
| 4: Conditional Requests", | ||||
| draft-ietf-httpbis-p4-conditional-19 (work in progress), | ||||
| March 2012. | ||||
| [I-D.ietf-httpbis-p5-range] | ||||
| Fielding, R., Lafon, Y., and J. Reschke, "HTTP/1.1, part | ||||
| 5: Range Requests and Partial Responses", | ||||
| draft-ietf-httpbis-p5-range-19 (work in progress), | ||||
| March 2012. | ||||
| [I-D.snell-http-prefer] | ||||
| Snell, J., "Prefer Header for HTTP", | ||||
| draft-snell-http-prefer-12 (work in progress), | ||||
| February 2012. | ||||
| [RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and | [RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and | |||
| Registration Procedures", BCP 13, RFC 4288, December 2005. | Registration Procedures", BCP 13, RFC 4288, December 2005. | |||
| [RFC5789] Dusseault, L. and J. Snell, "PATCH Method for HTTP", | ||||
| RFC 5789, March 2010. | ||||
| URIs | URIs | |||
| [1] <http://www.w3.org/Submission/wadl/> | [1] <http://www.w3.org/Submission/wadl/> | |||
| [2] <http://microformats.org/> | [2] <http://microformats.org/> | |||
| Appendix A. Frequently Asked Questions | Appendix A. Acknowledgements | |||
| A.1. Why not Microformats? | Thanks to Mike Amundsen, Bill Burke, Graham Klyne, Leif Hedstrom, and | |||
| Jeni Tennison for their suggestions and feedback. | ||||
| Appendix B. Frequently Asked Questions | ||||
| B.1. Why not Microformats? | ||||
| Browser-centric Web applications use HTML as their representation | Browser-centric Web applications use HTML as their representation | |||
| format of choice. While it is possible to augment HTML for non- | format of choice. While it is possible to augment HTML for non- | |||
| browser clients (using techniques like Microformats [2] ), a few | browser clients (using techniques like Microformats [2] ), a few | |||
| issues become evident when doing so: | issues become evident when doing so: | |||
| o HTML has a very forgiving syntax. While this is appropriate for | o HTML has a very forgiving syntax. While this is appropriate for | |||
| browsers (especially considering that there are many million HTML | browsers (especially considering that there are many million HTML | |||
| authors in the world), it makes for a less-than-precise language | authors in the world), it makes for a less-than-precise language | |||
| for machines, resulting in both overhead (parsing and | for machines, resulting in both overhead (parsing and | |||
| skipping to change at page 11, line 9 ¶ | skipping to change at page 12, line 40 ¶ | |||
| o HTML is presentation-centric, making it tempting to reformat it | o HTML is presentation-centric, making it tempting to reformat it | |||
| from time to time, to improve the "look and feel" of a page. | from time to time, to improve the "look and feel" of a page. | |||
| However, doing so can cause comparatively brittle non-browser | However, doing so can cause comparatively brittle non-browser | |||
| clients to lose their understanding of the content's semantics, | clients to lose their understanding of the content's semantics, | |||
| unless very careful controls are in place. | unless very careful controls are in place. | |||
| Because of this, it's most practical to define a separate format, and | Because of this, it's most practical to define a separate format, and | |||
| JSON is easily machine-readable, precise, and has a better chance of | JSON is easily machine-readable, precise, and has a better chance of | |||
| being managed for stability. | being managed for stability. | |||
| A.2. What about authentication? | B.2. What about authentication? | |||
| In HTTP, authentication is discoverable by interacting with the | In HTTP, authentication is discoverable by interacting with the | |||
| resource (usually, by getting a 401 Unauthorized response status | resource (usually, by getting a 401 Unauthorized response status | |||
| code, along with one or more challenges). While the home document | code, along with one or more challenges). While the home document | |||
| could hint it, this isn't yet done, to avoid possible security | could hint it, this isn't yet done, to avoid possible security | |||
| complications. | complications. | |||
| A.3. What about "Faults" (i.e., errors)? | B.3. What about 'Faults' (i.e., errors)? | |||
| In HTTP, errors are conveyed by HTTP status codes. While this | In HTTP, errors are conveyed by HTTP status codes. While this | |||
| specification could (and even may) allow enumeration of possible | specification could (and even may) allow enumeration of possible | |||
| error conditions, there's a concern that this will encourage | error conditions, there's a concern that this will encourage | |||
| applications to define many such "faults", leading to tight coupling | applications to define many such "faults", leading to tight coupling | |||
| between the application and its clients. | between the application and its clients. | |||
| So, this is an area of possible future development; if any such | So, this is an area of possible future development; if any such | |||
| mechanism appears here, it's likely to be quite restricted. | mechanism appears here, it's likely to be quite restricted. | |||
| A.4. How Do I find the XML Schema / JSON Schema / etc. for a particular | B.4. How Do I find the XML Schema / JSON Schema / etc. for a particular | |||
| media type? | media type? | |||
| That isn't addressed by home documents. Ultimately, it's up to the | That isn't addressed by home documents. Ultimately, it's up to the | |||
| media type accepted and generated by resources to define and | media type accepted and generated by resources to define and | |||
| constrain (or not) their syntax. | constrain (or not) their syntax. | |||
| Appendix B. Open Issues | Appendix C. Open Issues | |||
| The following is a list of placeholders for open issues. | The following is a list of placeholders for open issues. | |||
| o Refining and extending representation formats - "application/xml", | o Refining and extending representation formats - "application/xml", | |||
| for example, isn't enough. While a media type for every | for example, isn't enough. While a media type for every | |||
| representation is one answer, something like 'profile' might be | representation is one answer, something like 'profile' might be | |||
| good too. | good too. | |||
| o Object for contact details - do we need an object that describes | o Object for contact details - do we need an object that describes | |||
| who's running the API, etc? | who's running the API, etc? | |||
| o Defining new hints - guidance is needed on minting new hints. | o Defining new hints - guidance is needed on minting new hints. | |||
| End of changes. 32 change blocks. | ||||
| 64 lines changed or deleted | 150 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||