Back to HTTP Headers
Both

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.

curl -H "Content-Type: application/json" -X POST -d '{"name":"John"}' https://api.example.com/users
curl -I https://api.example.com/page
# Content-Type: text/html; charset=utf-8

Related Headers

Test Your APIs

content-type headerhttp content-typehttp headers guide