Verified against Semitexa Ultimate 2026.09.19.1020
Content Negotiation
A single endpoint serves JSON, HTML, or other formats depending on the Accept header or ?_format= query parameter.
How it works
The produces array on the payload's access attribute (#[AsPublicPayload], #[AsProtectedPayload], or #[AsServicePayload]) declares which Content-Types the endpoint supports. The framework negotiates the best match against the client Accept header and selects the appropriate response serializer.
Why this matters
Content negotiation lets one route serve both browser and API clients. The handler stays format-agnostic — it populates the resource DTO, and the framework handles serialization.