Sobes.tech
Junior — Middle

What information is specified in the Content-Type field of the HTTP header?

sobes.tech AI

Answer from AI

The Content-Type field in the HTTP header specifies the media type (MIME type) of the request or response body. This allows the client and server to understand in what format the data is transmitted.

For example:

  • application/json — data in JSON format
  • text/html — HTML document
  • application/xml — XML document
  • multipart/form-data — form data with files

Example header:

Content-Type: application/json

This indicates that the request or response body contains JSON data.