J-Kit
Português

http content-type header mime

HTTP Content-Type — how to set MIME types on the server

The HTTP Content-Type header tells the client the format of the response body. Setting it correctly avoids parsing errors, CORS issues and unexpected behaviour in browsers and proxies.

Setting Content-Type

  • nginx: use the standard mime.types file or add entries in the types{} block. Express: res.setHeader("Content-Type", "application/json"). AWS S3: set ContentType when uploading. Fastly/CloudFront: configure via cache policies and Response Headers.

Configuration examples

nginx types block

Input
types { application/wasm wasm; font/woff2 woff2; }
Expected output
Content-Type: application/wasm (para .wasm)

Add to the http{} or server{} block in nginx.conf.

Safe use

Input
context + tool result
Expected output
interpreted with limits and next steps

Use the result as technical or educational support, keeping the tool limits explicit in the workflow.

Full tool FAQ

A MIME type (or media type) is a two-part identifier — type/subtype — that tells the receiver what format a piece of data is in. Originally created for email (Multipurpose Internet Mail Extensions, RFC 2045), it is now ubiquitous in HTTP, where the Content-Type header defines how the browser interprets content.

Frequently asked questions

Do I need to include charset in the JSON Content-Type?

Not required. RFC 8259 specifies that JSON must be encoded in UTF-8, making the charset parameter redundant for application/json. Including it (application/json; charset=utf-8) is harmless but unnecessary.

Does this page replace official or professional review?

No. It helps explain the scenario and use the tool more safely, but real decisions should consider official sources, full context and qualified guidance when needed.