View Source JSONAPI.ContentTypeNegotiation (jsonapi v1.8.3)
Provides content type negotiation by validating the content-type
and accept
headers.
The proper jsonapi.org content type is
application/vnd.api+json
. As per the spec
This plug does three things:
- Returns 415 unless the content-type header is correct.
- Returns 406 unless the accept header is correct.
- Registers a before send hook to set the content-type if not already set.