I am wondering what to send in the body when you return a “No Content” or “Accepted” response?
As I know, body of “No Content” responses are usually removed by web servers, but the spec requires successful responses to contain either “data”, “links” or “meta” top-level members in the body. What do you think whether it is an ambiguity or not? Should the specification be updated to clarify that successful JSON API responses can also be empty if sent as “204 No Content”?
Regarding the “Accepted” status code: what is usually sent in the body? Maybe only the meta top-level member? Or could I just send an empty body too?
I’m unsure about the content headers. Should the response contain a Content-Type header or not?
The Spec states
Servers MUST send all JSON API data in response documents with the header Content-Type: application/vnd.api+json without any media type parameters.
But as it’s not a response document it would make sense to not include the Header, also this means a little inconsistency to taken care of in client libraries.