• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt

 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question from j2eecertificate
----------------------------

How do you add the content-type header "video/mpeg" to the response?

The correct answer given - response.setContentType ("video/mpeg");

why this is wrong?

response.setHeader ("content-type","video/mpeg");

can anyone please explain this?

Thanks.
 
Bimal Patel
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I feel that both are correct but the first one is more appropriate. While second one is kind of a facility to add your own header and if the header about to be set already exist, it would override the value for that header.
 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks 4 your reply
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic