ions ` ](/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options) header value
to ` nosniff ` to prevent this behavior.

In requests, (such as [ ` POST ` ](/en-US/docs/Web/HTTP/Methods/POST) or [ `
PUT ` ](/en-US/docs/Web/HTTP/Methods/PUT) ), the client tells the server what
type of data is actually sent.

Header type  |  [ Representation header ](/en-US/docs/Glossary/Representation_header)  
---|---  
[ Forbidden header name ](/en-US/docs/Glossary/Forbidden_header_name) |  no   
[ CORS-safelisted response header ](/en-US/docs/Glossary/CORS-safelisted_response_header) |  yes   
[ CORS-safelisted request header ](/en-US/docs/Glossary/CORS-safelisted_request_header) |  yes, with the additional restriction that values can't contain a _CORS-unsafe request header byte_ : 0x00-0x1F (except 0x09 (HT)), ` "():<>?@[\]{} ` , and 0x7F (DEL).   
It also needs to have a MIME type of its parsed value (ignoring parameters) of
either ` application/x-www-form-urlencoded ` , ` multipart/form-data ` , or `
text/plain ` .  
  
##  Syntax

http

    
    
    Content-Type: text/html; charset=utf-8
    Content-Type: multipart/form-data; boundary=something
    

##  Directives

` media-type `

    

The [ MIME type ](/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the
resource or the data.

charset

    

The character encoding standard. Case insensitive, lowercase is preferred.

boundary

    

For multipart entities the ` boundary ` directive is required. The directive
consists of 1 to 70 characters from a set of characters (and not ending with
white space) known to be very robust through email gateways. It is used to
encapsulate the boundaries of the multiple parts of the message. Often, the
header boundary is prepended with two dashes and the final boundary has two
dashes appended at the end.

##  Examples

###  ` Content-Type ` in HTML forms

In a [ ` POST ` ](/en-US/docs/Web/HTTP/Methods/POST) request, resulting from
an HTML form submission, the ` Content-Type ` of the request is specified by
the ` enctype ` attribute on the [ ` <form> ` ](/en-
US/docs/Web/HTML/Element/form) element.

html

    
    
    <form action="/foo" method="post" enctype="multipart/form-data">
      <input type="text" name="description" value="some text" />
      <input type="file" name="myFile" />
      <button type="submit">Submit</button>
    </form>
    

The request looks something like this (less interesting headers are omitted
here):

http

    
    
    POST /foo HTTP/1.1
    Content-Length: 68137
    Content-Type: multipart/form-data; boundary=---------------------------974767299852498929531610575
    
    -----------------------------974767299852498929531610575
    Content-Disposition: form-data; name="description"
    
    some text
    -----------------------------974767299852498929531610575
    Content-Disposition: form-data; name="myFile"; filename="foo.txt"
    Content-Type: text/plain
    
    (content of the uploaded file foo.txt)
    -----------------------------974767299852498929531610575--
    

##  Specifications

Specification  
---  
[ HTTP Semantics  
#  status.206  ](https://www.rfc-editor.org/rfc/rfc9110#status.206)  
[ HTTP Semantics  
#  field.content-type  ](https://www.rfc-editor.org/rfc/rfc9110#field.content-
type)  
  
##  Browser compatibility

BCD tables only load in the browser  with JavaScript enabled. Enable
JavaScript to view data.

##  See also

  * [ ` Accept ` ](/en-US/docs/Web/HTTP/Headers/Accept)
  * [ ` Content-Disposition ` ](/en-US/docs/Web/HTTP/Headers/Content-Disposition)
  * [ ` 206 ` ](/en-US/docs/Web/HTTP/Status/206) Partial Content 
  * [ ` X-Content-Type-Options ` ](/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options)

##  Help improve MDN

Was this page helpful to you?

Yes  No

[ Learn how to contribute
](https://github.com/mdn/content/blob/main/CONTRIBUTING.md "This will take you
to our contribution guidelines on GitHub.") .

This page was last modified on  Feb 8, 2024  by  [ MDN contributors ](/en-
US/docs/Web/HTT