• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Http request and response headers

 
devayani Devasthali
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have tried request.getHeader() method along with getHeaderNames().
with HeaderNames() got many results as - accept, referer etc.
still didnt get the exact meaning and use of them
where shall I get the exact info abt the same?
can u pls help me in foinding it out?
thanx in advance
regards
devayani
 
Arun Boraiah
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Generally header information is for the browsers to intimate the required behavior of the page being displayed.
Example if you don�t wish to cache the page, you can set this in the header of the page like this.

response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 1);

Which is equlivent of adding this html tags in the static html page.

<meta HTTP-EQUIV="Pragma" content="no-cache">
<meta HTTP-EQUIV="Expires" content="-1">

Like this there are many more header information that can be set. Details can be found in some good HTML books or even Goggle can help you�.

Regards
Arun
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a comprehensive treatment, read RFC 2616 - HTTP/1.1:

headers in general

request headers

response headers
[ February 16, 2006: Message edited by: Ulf Dittmer ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"devayani Dev", you have already been asked on at least one previous occasion to adjust your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Be aware that accounts with invalid display names are removed.

bear
JavaRanch Sheriff
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic