Accept

Content negotiation between client and server begins with the Accept request header, which indicates the media types a client prefers to receive.

Usage

The Accept header drives content negotiation. A client sends a list of media types ranked by preference, and the server selects the best match from the representations available for the requested resource.

Browsers set this header automatically based on the request context. A navigation request typically asks for text/html, while an image element asks for common image formats. API clients often send application/json or application/xml.

When the server has no representation matching any listed type, the specification leaves it two options: answer 406 Not Acceptable, or ignore the header and send the default representation. Most servers choose the default, since a page in the wrong format is more useful to the client than an error.

A response chosen through Accept carries Vary: Accept so caches store one variant per negotiated type. Without the Vary entry, a shared cache that stored the JSON representation hands it to the next browser asking for HTML.

Directives

media-type/subtype

A specific media type such as text/html or application/json. The server treats the full type/subtype pair as a concrete preference.

media-type/*

A wildcard subtype. image/* signals acceptance of any image format, whether image/png, image/webp, or image/avif.

*/* (wildcard)

Accepts any media type. This wildcard acts as a fallback when no other type matches.

;q= (quality value)

A weight between 0 and 1 expressing relative preference. Higher values indicate stronger preference. When omitted, the default weight is 1.0. A value of 0 means the type is not acceptable.

Example

A browser requesting an HTML page sends several media types ranked by quality value. The highest-weighted type the server supports wins.

Accept: text/html, application/xhtml+xml, */*;q=0.8

An API client requesting JSON with an XML fallback assigns a lower quality value to XML.

Accept: application/json, application/xml;q=0.9

An AI agent requesting a page in Markdown to reduce token consumption, with an HTML fallback.

Accept: text/markdown, text/html;q=0.9

An API client requesting structured error responses uses application/problem+json alongside the regular content type. The server returns problem details for errors and JSON for successful responses.

Accept: application/problem+json, application/json

A request listing multiple text formats with explicit priorities. text/html carries the default weight of 1.0, text/plain follows at 0.9, any other text format at 0.8, and everything else at 0.7.

Accept: text/html, text/plain;q=0.9, text/*;q=0.8, */*;q=0.7

Markdown negotiation for AI agents

Cloudflare converts HTML pages to Markdown on the fly when a request lists text/markdown in Accept and the zone has Markdown for Agents enabled. The network fetches the HTML from the origin, converts it, and answers with Content-Type: text/markdown. The response adds Accept to Vary so caches keep the Markdown and HTML variants apart, drops Content-Length because the conversion streams, and removes ETag, Last-Modified, Content-Encoding, and Content-Range because they described the original HTML body and conditional requests cannot be honored for a converted response. When the origin sends no content-signal header, Cloudflare adds a default one so the agent sees a usage policy. The conversion strips markup and navigation, so the page costs far fewer tokens, which is the reason agents send the header. A zone without the feature enabled, or a site behind another CDN, serves the HTML fallback from the same Accept value.

Crawlers and Accept

Nearly every verified crawler sends Accept. Googlebot smartphone lists text/html, application/xhtml+xml, and application/xml, and still includes application/signed-exchange alongside HTML. The signed-exchange entry belongs to the AMP delivery path, where the same requests carry AMP-Cache-Transform, although Google Search no longer serves AMP through its cache or signed exchanges. OAI-SearchBot asks for text/plain, and Meta-WebIndexer lists browser-style image types alongside HTML. Amazonbot sends no Accept header at all. Servers negotiating on the header serve each of them the HTML representation, and a server returning 406 for an unexpected list blocks the crawler outright.

Verified crawler probe

Probe data from verified crawler traffic (November 2026 snapshot) shows which bots send Accept when requesting pages. Yes marks the header on at least nine of ten sampled requests from the bot, Sometimes marks a smaller share, and No marks absence.

Crawler Sends Accept
Amazonbot No
Applebot Yes
Baiduspider Yes
Bingbot Yes
ClaudeBot Yes
DuckDuckBot Yes
GPTBot Yes
Googlebot Yes
Googlebot (smartphone) Yes
Googlebot-Image Yes
Meta-ExternalAgent Yes
Meta-WebIndexer Yes
OAI-SearchBot Yes
PerplexityBot Sometimes
SeznamBot Yes
YandexBot Yes
YandexFavicons Yes

See also

Last updated: November 3, 2026