Accept Header
Pronunciation: ak-SEPT HED-er
Also known as: HTTP Accept Header, Accept Request Header
Definition
Accept Header is an HTTP request header that tells a server which response media types the client can understand and may rank them by preference. Accept describes desired response formats, whereas Content-Type describes the representation actually sent in a request or response body. A production implementation should publish supported media types, parse quality values correctly, return a clear not-acceptable response when negotiation fails, and test default behavior across API versions. The principal risks include unexpected response formats, silent fallback, broken deserialization, cache variation errors, incompatible clients, and security filters applied to the wrong representation.
Overview
Accept Header is an HTTP request header that tells a server which response media types the client can understand and may rank them by preference. The Accept Header owner should publish stable error semantics and guidance on whether correction, retry, status lookup, or escalation is appropriate.
The principal risks include unexpected response formats, silent fallback, broken deserialization, cache variation errors, incompatible clients, and security filters applied to the wrong representation. Accept describes desired response formats, whereas Content-Type describes the representation actually sent in a request or response body.
A production implementation should publish supported media types, parse quality values correctly, return a clear not-acceptable response when negotiation fails, and test default behavior across API versions. A successful transport result from Accept Header should not be interpreted beyond the exact API state documented by the provider.
Useful measures include media-type negotiation failures, 406 responses, fallback usage, client-version distribution, and parsing errors by response type. Accept Header is closely connected to Content-Type Header, Backward-Compatible Change, and Response Schema. Changes to Accept Header should be checked against older clients, stored payloads, enum growth, default behavior, and retry assumptions.
Observability for Accept Header should record operation, version, principal, request ID, latency, retry count, error code, and final state without exposing secrets. Testing Accept Header should cover malformed input, denied access, rate limits, timeouts, duplicates, asynchronous completion, and version changes.
Data handled by Accept Header should use documented types, units, timestamp rules, nullable fields, and enum behavior to prevent silent interpretation errors. The Accept Header contract should define identifiers, validation, authorization, status semantics, errors, limits, and version behavior at the same boundary.
Key Takeaway
Publish supported media types, parse quality values correctly, return a clear not-acceptable response when negotiation fails, and test default behavior across API versions.
Sources
- HTTP Semantics — IETF (2026-08-03)
- HTTP Caching — IETF (2026-08-03)
- OpenAPI Specification — OpenAPI Initiative (2026-08-03)