Content negotiation for handlers: picking a representation from the
requester's Accept header.
A gateway serving both HTML and JSON needs this, and the alternative —
headers.get("accept")?.includes("json") — quietly gets q-values, wildcards
and ordering wrong. Pure and browser-safe.
Content negotiation for handlers: picking a representation from the requester's
Acceptheader.A gateway serving both HTML and JSON needs this, and the alternative —
headers.get("accept")?.includes("json")— quietly gets q-values, wildcards and ordering wrong. Pure and browser-safe.