Content-Type

The header that states what format a message body is in, such as application/json.

In more detail

Whoever sends a body sends Content-Type, so it appears on requests with bodies and on responses. It is a statement of fact about the bytes present, while Accept is the caller’s wish list. A new format, such as newline-delimited JSON for a stream, needs its own content type so the client knows how to read it.

Examples

application/problem+json for Problem Details errors
text/event-stream for Server-Sent Events
Content-Type: application/json
Kafka record header: ('content-type', b'application/json')

Related terms

Taught in

References