diff --git a/format/index.md b/format/index.md index e488976a1..b03c0c8c1 100644 --- a/format/index.md +++ b/format/index.md @@ -26,28 +26,40 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", interpreted as described in RFC 2119 [[RFC2119](http://tools.ietf.org/html/rfc2119)]. -## Media Type Negotiation +## Content Negotiation -Clients **MUST** send all JSON API data in request documents with -the header `Content-Type: application/vnd.api+json`. +Clients **MUST** send all JSON API data in request documents with the header +`Content-Type: application/vnd.api+json`, without any media type parameters. -Clients **MUST** ignore all parameters for the `application/vnd.api+json` -media type received in the `Content-Type` header of response documents. +If a client violates this requirement, servers **MUST** respond with a +`415 Unsupported Media Type` status code. + +Clients that include the JSON API media type in their `Accept` header, **MUST** +specify the media type there at least once without any media type parameters. + +If a client violates this requirement, and its `Accept` header doesn't contain +any other media types that the server can produce, the server **MUST** respond +with a `406 Not Acceptable` status code. -Servers **MUST** send all JSON API data in response documents with -the header `Content-Type: application/vnd.api+json`. +Servers **MUST** send all JSON API data in response documents with the header +`Content-Type: application/vnd.api+json`, without any media type parameters. -Servers **MUST** return a `406 Not Acceptable` status code if the -`application/vnd.api+json` media type is modified by the `ext` parameter in -the `Accept` header of a request. Otherwise, servers **MUST** return a `415 -Unsupported Media Type` status code if the `application/vnd.api+json` media -type is modified by the `ext` parameter in the `Content-Type` header of a -request. Servers **MUST** ignore all other parameters for the -`application/vnd.api+json` media type in `Accept` and `Content-Type` -headers. +Servers **MUST NOT** send responses with the `application/vnd.api+json` media +type if the client has not indicated, using its `Accept` header, that it can +understand this format. -> Note: These requirements may allow future versions of this specification -to support an extension mechanism based upon the `ext` media type parameter. +> Note: If a client's `Accept` header indicates that it accepts standard JSON +but not the JSON API media type, the server may choose serve it a JSON API +document identified as `application/json`. If the server does so, is not +considered to be sending "JSON API data" for the purposes of the requirement +above, but rather simple JSON data, and the client cannot rely on any of the +rules laid out in this specification. + +Clients **MUST** ignore any parameters for the `application/vnd.api+json` +media type received in the `Content-Type` header of response documents. + +> Note: These requirements exist to allow future versions of this specification +to use media type parameters for extension negotiation and versioning. ## Document Structure @@ -592,16 +604,6 @@ The following characters **MUST NOT** be used in member names: Data, including resources and relationships, can be fetched by sending a `GET` request to an endpoint. -Clients **MUST** indicate that they can accept the JSON API media type, per -the semantics of the HTTP `Accept` header. If present, this header value **MUST** -also include any media type extensions relevant to the request. Servers **MUST** -return a `406 Not Acceptable` status code if this header specifies an -unsupported media type. - -> Note: Servers may support multiple media types at any endpoint. For example, -a server may choose to support `text/html` in order to simplify viewing content -via a web browser. - Responses can be further refined with the optional features described below. ### Fetching Resources @@ -1071,10 +1073,6 @@ strategies. A server **MAY** allow resources of a given type to be created. It **MAY** also allow existing resources to be modified or deleted. -Any requests that contain content **MUST** include a `Content-Type` header -whose value is `application/vnd.api+json`. This header value **MUST** also -include media type extensions relevant to the request. - A request **MUST** completely succeed or fail (in a single "transaction"). No partial updates are allowed. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy