HEAD Requests: Getting Information About a Server-Side File

The previous sections described how to use GET and POST methods to send information to a server-side program and retrieve the server-side program's response. Sometimes, in addition to the information returned by the webserver, a response can contain information about the response itself. This kind of information, sometimes called metadata, is stored in a normally invisible part of the response called the response header. A response can have many headers. Headers might include information such as the number of kilobytes in the response, when the response was sent, and when that file was last updated. Here are some of the headers returned by Flickr.com when it answers an Ajax request:

Get The Book of JavaScript, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.