• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

when and how to use a 'head' request?

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Would anyone advice me when and how i can use the 'head' request.. that will invoke the doHead() method on a servlet?

Pl. brief what is the effect of the response made within the 'doHead()' method.

Thanks in adv...
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the HTTP 1.1 documentation RFC2616

The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The
metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the
information sent in response to a GET request. This method can be used for obtaining metainformation about the
entity implied by the request without transferring the entity-body itself. This method is often used for testing
hypertext links for validity, accessibility, and recent modification.
The response to a HEAD request MAY be cacheable in the sense that the information contained in the response MAY
be used to update a previously cached entity from that resource. If the new field values indicate that the cached entity
differs from the current entity (as would be indicated by a change in Content-Length, Content-MD5, ETag
or Last-Modified), then the cache MUST treat the cache entry as stale.


I think the most important use is to determine the last modification date of a page to save on bandwidth and CPU time.
Bill
[ May 29, 2004: Message edited by: William Brogden ]
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Vanchin Vanchin",
Sorry, but your name does not comply to the JavRanch naming rules. Please see them here.

We require your display name to be two words: your first name, a space, then your last name. Obviously fictitious names are not allowed. Please edit your profile and fix you display name.

Accounts with invalid display names get deleted, often without warning, and you have 33 posts with an invalid display name. Your account is likely to be closed soon, so please update your display name immediately.

thanks, Dave.
 
Forget Steve. Look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic