SIF - Header (http HEAD)

From SIF Documentation - BaseArchitecture_3-2.pdf      Copyright © Access 4 Learning

Head is an abbreviation for headers taken from the HTTP method HEAD. HEAD is identical to the GET method except it only returns the headers that would be present for the same request and not the body. This can be more efficient and therefore useful in many situations. In order to realise these efficiencies, retrieving just the headers is supported on the Request Connector.

Example Uses of Head

  • Initialize “Changes Since” for the first time.
  • Serve as a service level ping to check availability.
  • Ascertain the number of pages a query will (likely) result in.
  • Check if data has changed or if your copy is current.

For each supported GET call a provider should support the corresponding HEAD operation. If the provider is unable to support the HEAD method for a particular service an error of 405 (Method Not Allowed) must be returned. The consumer should then fallback to the corresponding GET operation. At this point the consumer may need to be built such that it ignores the body of in this request’s return.

It is important to keep in mind that while a properly used HEAD is more efficient than a GET, that efficiency is most likely only realized on the wire. In most cases it will require nearly as many server resources to service a HEAD request as it would to handle an otherwise identical GET request. As always be judicious in your use of requests.