0proto / haxe-Ajax

A simple library for firing promise-based 'ajax' requests (useful when interacting with REST APIs).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

haxe-Ajax

License

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.

About

A simple library for firing promise-based 'ajax' requests (useful when interacting with REST APIs).

License:MIT License


Languages

Language:JavaScript 93.2%Language:Haxe 6.1%Language:HTML 0.7%