# `JSONAPI.ContentTypeNegotiation`
[🔗](https://github.com/beam-community/jsonapi/blob/main/lib/jsonapi/plugs/content_type_negotiation.ex#L1)

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](http://jsonapi.org/format/#content-negotiation-servers)

This plug does three things:

1. Returns 415 unless the content-type header is correct.
2. Returns 406 unless the accept header is correct.
3. Registers a before send hook to set the content-type if not already set.

# `call`

# `init`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
