If you are not sure, use application/json - this is a universal MIME type that requires that the returned data is only properly formed JSON .
The MIME type application/vnd.api+json reserved for communication using the JSON API protocol (with a strange name).
"JSON API" in this context does not mean any API based on HTTP and JSON. It is also not a fully defined API - rather, it is a platform for creating APIs that allow the client to retrieve and modify related objects. For example, a blog application may implement an API that conforms to the "JSON API" specification, which allows you to retrieve the last 10 articles of a given author with metadata and comments for each article in a single HTTP request.
The specification defines, in particular:
- a specific method for generating the request (i.e. which URL parameters control the sorting and pagination and the data included in the output);
- The specific structure of the JSON document in the response, for example:
The document MUST contain at least one of the following top-level members:
data : documents "primary data"errors : array of error objectsmeta : a meta object that contains non-standard meta information.
data and errors MUST NOT coexist in the same document.
Nickolay Apr 13 '17 at 14:22 2017-04-13 14:22
source share