Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are HTTP headers (Content-Type, &c.) case-sensitive? [duplicate]

Perhaps I'm skimming too fast, but couldn't find this specifically documented. In my particular case, I'm wondering about the "Content-Type" header, but I'm assuming the same rules would apply to other standard headers.

Are these case sensitive, and if so: Is it Content-Type or Content-type?

Is there a proper place to reference these?

like image 776
anonymous coward Avatar asked Oct 10 '11 20:10

anonymous coward


People also ask

Is Content-Type a request header?

The Content-Type http request header specifies the content type of the http request payload. The Content-Type header is NOT tied to the content type of the response sent by the server. Here's an example using pure JavaScript to make an asynchronous HTTP request from the browser.

What are the contents in HTTP header?

An HTTP response header includes information in a text-record form that a Web server transmits back to the client's browser. The response header contains particulars such as the type, date and size of the file sent back by the server, as well as information regarding the server.

What is Content-Type in HTML?

The text/html content type is an Internet Media Type as well as a Multipurpose Internet Mail Extensions (MIME) content type. Using HTML in MIME messages allows the full richness of Web pages to be available in e-mail. text/plain [RFC1521] The text/plain content type is the generic subtype for plain text.


Video Answer


1 Answers

Case-insensitive.

Hypertext Transfer Protocol -- HTTP/1.1:

4.2 Message Headers

HTTP header fields, which include general-header (section 4.5), request-header (section 5.3), response-header (section 6.2), and entity-header (section 7.1) fields, follow the same generic format as that given in Section 3.1 of RFC 822 [9]. Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive.

like image 174
Roman R. Avatar answered Oct 05 '22 02:10

Roman R.