0.0.8 • Published 7 years ago

ajax-utils v0.0.8

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

Simple Ajax Wrapper that uses promises

Example:

import * as Ajax from 'ajax-utils';

var req = new Ajax.Request('get', '/someurl/:id', {id: 3}); // url replace

req.headers = {
    'ETag': 'something'
};
 

// This will transform the request and response 
// {fooBar: 2} will be sent as {foo_bar:2} and the reverse transform applied
// to the response
req.transform = Ajax.Transform.CamelCaseToUnderscore;
req.applyReverseTransformToResponse = true;

req.send().then((response: Ajax.Response) => {
    // do something with the response
    var res = response.bodyJSON;
}).done();
0.0.8

7 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago