DevKits

Request negotiation · Request header

Accept

Which media types the client can process.

What is Accept?

Accept expresses what the client wants back. Content negotiation lets a server return HTML for browsers and JSON for API clients from the same URL.

Typical usage

Set explicitly on API calls to signal the desired response format.

Examples

Prefer JSON, fallback to XML

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

Any type

Accept: */*

Specification

RFC 9110 §12.5.1

Related headers