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
- content negotiation — The way a client and server agree on the format, language or compression of a response using request headers such as Accept.
- Content-Type — The header that states what format a message body is in, such as application/json.
- Vary header — The response header that lists which request headers changed the answer, so caches keep separate copies for each value.
- 406 Not Acceptable — The HTTP status meaning the server cannot produce any format the Accept header asked for.
- HTTP header — A named line of metadata in an HTTP message, such as Content-Type: application/json, that describes the body, the caller or how to handle the exchange.
- HTTP request — The message a client sends to a server: a method, a target, a protocol version, headers, a blank line and an optional body.
- media type — A standard label for a data format, written type/subtype, such as application/json or text/event-stream.
- next/image — The Next.js Image component, which resizes, converts and lazy-loads images and reserves their space to prevent layout shift.
Taught in
- What An API Is, And The Alternatives — Modern API Architecture: REST, GraphQL & gRPC
- Headers And Content Negotiation — Modern API Architecture: REST, GraphQL & gRPC
- HTTP Is Text: Requests, Status Codes And Headers — Linux Fundamentals & Systems Administration
- Image & Font Optimization: Zero Layout Shift Assets — Next.js 15 & Modern App Router Architecture