Accept header

The request header in which a client lists the formats it can read, such as Accept: application/json.

In more detail

Accept is a wish list and may carry preferences; the wildcard */* means anything will do and is what curl sends by default. If nothing on the list can be produced the server answers 406, and because the answer depended on Accept it must say so with Vary: Accept.

Example

The server uses it to choose a representation. A mismatch can produce a 406 status or an unexpected format.

Related terms

Taught in

References