ShareYourGroupShareYourGroupHTTP Codes and Headers

Content-Type and character set

The Content-Type header says what the bytes of the body are. Browsers and programs choose how to treat the data from it.

A real example

GET /json HTTP/1.1
Host: example.com

HTTP/1.1 200 OK
Date: Sat, 14 Nov 2026 10:00:00 GMT
Content-Type: application/json
Content-Length: 7

{"a":1}

Common values

ValueUsed for
text/html; charset=utf-8Web pages
text/css and text/javascriptStyles and scripts
application/jsonJSON data from APIs
application/x-www-form-urlencodedA normal HTML form body
multipart/form-dataForms with file uploads
image/png, image/webp, image/jpegPictures
application/pdfPDF files
application/octet-streamUnknown binary data, often shown as a download

The character set

Text types should say how the letters are encoded. charset=utf-8 is the right choice for nearly everything today and covers Hindi, Punjabi and every other script. Without it, a browser guesses, and the guess can turn text into strange symbols. You can also set it inside the page with <meta charset="utf-8">; the header has priority.

When the type goes wrong

Paste a response into the header checker: it notes a missing type and a missing charset on HTML.

Does the file extension decide the type?

Not for browsers on the web: they use the header. Servers often choose the header from the extension, so the extension matters indirectly.

Sources

  • RFC 9110 section 8.3 (Content-Type)

Read on 14 November 2026.

This is an independent guide. It is not connected with the IETF, IANA, any browser maker or any company named here. Meanings were checked against the RFC texts on 14 November 2026. Responses shown were recorded on 14 November 2026 from a small test server on the author's own computer.