HTTP Accept Header
Informs the server about the media types the client can process in the response. The server uses content negotiation to select one of the proposed formats.
Purpose
Tells the server what content types (MIME types) the client understands and prefers to receive.
Accept: type/subtype Accept: type/subtype, type/subtype Accept: */* (any type)
Code Examples
See how to use the Accept header in different tools and languages.
Related Headers
Content-Type
Indicates the media type (MIME type) of the resource being sent. Tells the client how to interpret the response body.
Accept-Encoding
Indicates which content encoding (compression algorithm) the client supports. The server may compress the response body using one of these methods.
Accept-Language
Indicates which natural languages the client prefers. The server uses this for content negotiation to return the appropriate language version.
Vary
Determines how the response should be cached based on request headers. Ensures caches serve the correct version based on varying request criteria.