Content-Type

Indicates the media type of the request or response body. Includes optional charset for text types.

Both

Syntax

Content-Type: <media-type>; charset=<encoding>

Example values

ValueExplanation
application/jsonJSON payload
application/x-www-form-urlencodedForm data
multipart/form-data; boundary=----WebKitFormBoundaryFile upload
text/html; charset=utf-8HTML with charset

cURL usage

curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' https://api.example.com

Common mistakes

Forgetting Content-Type for JSON (server may not parse); wrong charset for non-UTF-8.

Related headers

Tools

HTTP Header Viewer →