| Author |
HF book pg133 ~ setHeader("content-type")
|
Lee Kian Giap
Ranch Hand
Joined: Jan 23, 2008
Posts: 210
|
|
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 !!!
|
SCJP 6, SCWCD 5, SCBCD 5
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9189
|
|
|
I don't think HTTP headers are case sensitive. So content-type is the same as Content-Type...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
Milton Ochoa
Ranch Hand
Joined: Oct 23, 2007
Posts: 336
|
|
|
I am agree with Ankit
|
 |
 |
|
|
subject: HF book pg133 ~ setHeader("content-type")
|
|
|