IO/ Gateway.js

This library gives the ability to directly communicate with a server using the XMLHTTPRequest object in a non-browser specific way.

Copyright

2004-2006 Rob Rohan (robr.nosp@m.ohan@gmai.nosp@m.l.com).  All rights reserved

Related

Util/Collections.js Util/Browser.js

Summary
This library gives the ability to directly communicate with a server using the XMLHTTPRequest object in a non-browser specific way.
This creates a HTTPConnection factory that can produce http connetion object that are IE and Mozilla capable they can be used to GET and POST to a server It is oftend used in one go like:
get an instace of the http connect object this actually just creates either an MS or Gecko type object.
This object handles sending.
Used to do an actual request.
This method implements a multi-field form submission via a POST, using the ‘fields’ object as a set of name:value pairs to pass as the form fields.
the current version

Pipe

This creates a HTTPConnection factory that can produce http connetion object that are IE and Mozilla capable they can be used to GET and POST to a server It is oftend used in one go like:

var pipe = new Sortie.IO.Pipe().GetInstance();

Namespace

Sortie.IO

Returns

a factory to create xmlhttprequest objects with

Summary
get an instace of the http connect object this actually just creates either an MS or Gecko type object.

Functions

Pipe. GetInstance

get an instace of the http connect object this actually just creates either an MS or Gecko type object.

Returns

An XMLHTTPRequest instance that should behave the same on all browsers

Gateway

This object handles sending.  This can be used to send and receive data from the server

Namespace

Sortie.IO

Parameters

connectionan XMLHTTPRequest object from the HTTPConnectFactory used to send and receive with
asynboolean for async or sync mode.  True means async false means sync
Summary
Used to do an actual request.
This method implements a multi-field form submission via a POST, using the ‘fields’ object as a set of name:value pairs to pass as the form fields.
the current version

Functions

Gateway. DoRequest

Used to do an actual request.  Pass in an anon object with the connection specifics.  For example:

var httpcon = new HTTPConnectFactory().getInstance();
var remote = new JSRemote(httpcon, true);

remote.doRequest({
method:"POST",
url:"http://mysite.com/handler.php",
handler:function(e,conn){ alert(e) },
body:""
});

Parameters

paramsan object that has some combo of the following properties
method = GET,POST,DELETE,PUT,etc
url = where to call to
handler = the call back function
error_handler = error handler
body = the body data (for posts)
fields = for form posts, the fields
extra_headers = any extra headers to pass along
function = the SOAP function (if a soap request)
username = the http username
password = the http password
encoding = default is utf-8

Gateway. DoFormPostRequest

This method implements a multi-field form submission via a POST, using the ‘fields’ object as a set of name:value pairs to pass as the form fields.  It simply delegates to doPostRequest for the actual processing; the only functionality is serializing the fields.

Note that this method’s parameter ordering does NOT correspond to doPostRequest’s.

Parameters

urlthe url to POST to
fieldsthe form fields to POST
handlerthe callback function to send results to

Variables

Sortie. Util. Gateway. VERSION

the current version