AJAX - The Complete Reference

(avery) #1

592 Part IV: Appendixes


Header Description Examples
Allow Indicates the HTTP methods supported
by the resource. Typically seen in a 405
(Method Not Allowed) response.

Allow: GET, HEAD

Content-Encoding Indicates the encoding the data is in. Content-encoding: gzip
Content-Language Indicates the language used for the
request or response.

Content-Language: es

Content-Length Gives the length in bytes of the message
being sent to or from the server, if any.
Remember that the browser can upload or
pass data using the PUT or POST method.
In the case of a HEAD request, this value
indicates what would have been passed
back if a GET had been used.

Content-Length: 1968

Content-Location The actual location (URL) of a resource.
Not always used as it is considered a
security risk by some because it may
expose translated addresses. Its use
in requests is not as well understood,
despite it being an entity header.

Content-Location:
intranet.ajaxref.com/
files/httpcodes.txt

Content-MD5 Contains an MD5 checksum of a
message body; useful for verifying the
integrity of a passed message.

Content-MD5: 00587edd8c0f
dcfcb6bda6856dfb304b

Content-Range Used with a partial body to specify where
this piece fits in the entire body. It must
specify the start and end byte positions
of the partial body. In addition, it should
include the total length of the entire
body if possible.

Content-range: bytes
500-999/7220

Content-Type Indicates the MIME type of a message
being sent to or from a server. Typically
all file responses would be stamped
with a Content-Type to indicate
to the browser what kind of data it is
receiving. In this role, Content-Type is
the most important of the headers in a
response. However, it can also be used
from a request point of view. The value in
this case is for data submission and is
particularly important in the case of form
post or file upload.

Content-Type: image/gif

Content-Type:
application/x-www-form-
urlencoded

Expires Gives the date/time after which the data
should be considered stale and should
not be returned from a cache. Times far
in the past indicate immediate cache
invalidation.

Expires: Thu, 04 Dec 1997
16:00:00 GMT

Last-Modified Indicates the last modification of a data
entity. Integral for cache control, Found
most often in responses.

Last-Modified: Mon, 30
Apr 2007 22:37:16 GMT

TABLE B-4 Entity Headers in HTTP 1.1
Free download pdf