• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HF book pg133 ~ setHeader("content-type")

 
Lee Kian Giap
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In page133 , it mentioned that response.setHeader("content-type","text/html"); has no difference with response.setContentType("text/html");

As I refer to Chapter 1 , the content-type header in HTTP Response is "Content-Type", I mean it comes with Uppercase "C" and "T".

So, my question is response.setHeader("content-type","text/html"); will create a "content-type" header instead of "Content-Type" header in HTTP Response , may I know whether the HTTP Response header case sensitive when the web browser read it ?

Thank you !!!
 
Ankit Garg
Sheriff
Posts: 9580
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think HTTP headers are case sensitive. So content-type is the same as Content-Type...
 
Milton Ochoa
Ranch Hand
Posts: 336
Firefox Browser Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am agree with Ankit
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic