NAME

HTTP.Request

DESCRIPTION

This provides a way to make a HTTP request in a completely browser-independent fashion, if the browser can support this kind of activity.

DEPENDENCIES

None.

CLASSES

HTTP.Request

This is the basic AJAX communicator. It does all of its work within the constructor, using callbacks as provided (if in asynchronous mode).

The constructor takes a hash of options. All option names are case-insensitive. These options are:

The callback functions must be defined as so:

  onComplete: function (trans) {
      ...
  }

where 'trans' is the transport being used. This will be an object of HTTP.Request.Transport, as detailed below.

The following public methods are defined:

HTTP.Request.Transport

This is the class that actually does the tranport. In Gecko-based browsers, this is equivalent to the XMLHttpRequest class. In IE-based browsers, this is equivalent to the correct ActiveX object. In other browsers, this is an object that abstracts away the layers/iframe method that is used.

TODO

HTTP.Request.Transport

This is a class that is the default transport mechanism. It is set, at compile-time, to the best XMLHttpRequest option the browser supports.

If the browser does not support XMLHttpRequest or any of the ActiveXObject() variants, then an HTTP.Request.Transport class is created to transparently do IFRAME/DIV support.

If you wish to write your own transport class, you can do so and pass it in as the 'transport' option to new() or set it using setOption( "transport", My.Transport.Class ).

Any class you provide must support the following API:

(This was taken from http://www-128.ibm.com/developerworks/web/library/wa-ie2mozgd/)

SUPPORT

Currently, there is no mailing list or IRC channel. Please send bug reports and patches to the author.

AUTHOR

Rob Kinyon (rob.kinyon@iinteractive.com)

Code taken from several sources, including those written by Sam Stephenson, Adam Kennedy, and Eric Andreychek. Many thanks to their generous help.

My time is generously donated by Infinity Interactive, Inc. http://www.iinteractive.com

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 107:

You forgot a '=back' before '=head2'