Request body
Contains the representation or command data sent with a request.
- Also known as
- Request payload, Inbound body, Submitted representation
- AI prompt
Process a request body as a bounded stream with an allowed content type, decompression limits, schema validation, unknown-field policy, cancellation and safe parse errors. Avoid buffering unbounded payloads, reject trailing data when inappropriate, and never log the raw body by default.
Response body
Contains the representation or result returned by the server.
- Also known as
- Response payload, Outbound body, Returned representation
- AI prompt
Produce a schema-valid response body from an explicit response DTO, omitting internal and unauthorized fields. Match it to the status and content type, stream large output, encode dates and numbers consistently, handle serialization errors before headers commit, and avoid bodies for HEAD, 204 and 304 responses.
Content-Type
Declares the media type and optional parameters of a message body.
- Also known as
- Media type header, MIME type, Representation type
- AI prompt
Validate request Content-Type against an explicit allowlist before parsing and return 415 for unsupported media. Set the response Content-Type from the actual serializer, include charset where appropriate, prevent MIME sniffing, and never copy an untrusted header directly into the response.
Content negotiation
Selects a representation based on client preferences and server capabilities.
- Also known as
- Representation negotiation, Media negotiation, Format negotiation
- AI prompt
Implement deterministic content negotiation across the supported media types and languages. Respect quality weights, define stable defaults, return 406 when required, set the matching Content-Type and Vary headers, keep error formats consistent, and avoid multiplying cache variants without need.