The gluttony module was created to easily consume a REST service using AJAX. It is a minimalist library; it doesn't rely on other dependencies and is simple in nature.
bower
bower install gluttony --save
npm
npm install gluttonyjs --save
- Doesn't support IE5/6 or older browsers.
Include gluttony; <script src='path/to/gluttony.js'></script>
var data = {email: 'abc@def.ghi', password: '123'}
gluttony.post('/api/register', data, function(error, response) {
console.log('Server response: ' + response)
})
gluttony.get('/api/stats', function(error, response)) {
console.log('Server stats: ' + response)
})