AJAX - The Complete Reference

(avery) #1

PART IV


Appendix B: HTTP 1.1 Reference 589


NNOT EOTE A CONNECT method is also reserved in HTTP 1.1 to use with a proxy to tell it to act like
a tunnel.

NNOT EOTE Some user-agents may also support the various WebDav (www.webdav.org) methods such as
MOVE, PROPFIND, PROPPATCH, MKCOL, COPY, LOCK, UNLOCK, POLL, and others.
As demonstrated in Chapter 3, these methods will work fine within Ajax but are not supported
ubiquitously by client or server; readers are directed to the Web to read up on them.

HTTP Headers


Both HTTP requests and responses will contain headers. Regardless of type, headers follow
a format like:

Header-name : Header-value

where Header-name is the name of the particular header, such as User-Agent, and
Header-value is the corresponding value, such as Mozilla/5.0. The capture here shows
a few headers in a request:

NNOT EOTE As shown throughout the book, using an HTTP debugging tool will be quite useful. Browser-
hosted tools like Firebug (www.getfirebug.com) for Firefox or local proxy tools like Fiddler
(www.fiddlertool.com), which is browser agnostic are good places to start. If you’d like more choices,
visit http://ajaxref.com/resources.html for a list of useful JavaScript and Ajax tools and resources.

The HTTP 1.1 specification defines a number of different types of headers, including
custom or more appropriately extension headers. Table B-2 lists the types of headers and a
simple example of each.

Header Type Description Example
General header Exists in either request or
response

Date: Sun, 11 Aug 2001 13:24:52
GMT

Request header Specific to making a request Accept-Encoding: gzip,deflate
Response header Specifically found in responses ETag: "4135cda4"
Entity header Describes a resource or payload Content-Length: 1968
Extension header New headers often defined by
a developer

X-Powered-By: Starbucks Mocha

TABLE B-2 HTTP Header Categories
Free download pdf