Client Class wwHttp

The wwHttp class provides a thin wrapper around the browser XmlHttp object to allow making callbacks. The control manages hooking up a callback handler and managing errors by calling the callback handler or error handler when the calls complete.

Focus of this control is to make the callback process very easy but still provide robust error management.

To make multiple simultaneous callbacks create multiple instances of this class.

function wwHttpSample() { var Http = new wwHttp(); var Result = Http.send("http://localhost/",null,TestCallback,OnError); } function TestCallback(Result) { alert("SUCCESS" + Result); } function OnError(Result) { alert("*** On Error Called:\r\n\r\n" + Result.message); }


This class has no dependencies on server side features.

Class Members

appendHeader Appends an HTTP header to the current request.
encodeFormVars Creates a URL encoded string of all the form variables for a given form on the page.
encodeValue Urlencodes a single value.
returnError This method creates a CallbackException object and then calls teh errorCallback function for this wwHttp instance if one is defined.
send Used to make an asynchronous HTTP call to the server and return the result into a callback function. This method provides error handling and any errors that occur are fired into the OnError handler.
contentType The content type for any POST data that might be sent.
evalResult Determines whether the result from the callback is automatically evaluated using eval(). Useful for JSON responses.


See also:

Class wwHttp

  Last Updated: 10/9/2007 | © West Wind Technologies, 2008