HTTP Content-Type Header
Indicates the media type (MIME type) of the resource being sent. Tells the client how to interpret the response body.
Purpose
Essential header that tells the receiver the format of the data — JSON, HTML, XML, binary, etc.
Content-Type: application/json Content-Type: text/html; charset=utf-8 Content-Type: multipart/form-data; boundary=---123 Content-Type: application/xml
Code Examples
See how to use the Content-Type header in different tools and languages.
Related Headers
Accept
Informs the server about the media types the client can process in the response. The server uses content negotiation to select one of the proposed formats.
Content-Encoding
Indicates which compression algorithm was applied to the response body. The client must use the same algorithm to decompress the data.
Content-Length
Indicates the size of the response body in bytes. Helps the client know how much data to expect and when the response is complete.
Content-Disposition
Indicates how the response content should be displayed. Can suggest a filename for download or indicate inline display.