haxe-Ajax
A simple library for firing promise-based 'ajax' requests (useful when interacting with REST APIs).
Examples
Loading Data
// fire the ajax request
// using GET, to /test
Ajax.request(
HTTPMethod.GET,
'/test'
).then(function(res:Response) {
// alert the user of the response
Browser.console.log(res.response);
}).catchError(function(err:Dynamic) {
// if an error comes up, report it!
Browser.console.error(err);
});
Live Sample
A live sample is available which loads data from the server asynchronously.