Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zkochan/tiny-ajax
A tiny XMLHttpRequest wrapper.
https://github.com/zkochan/tiny-ajax
Last synced: 28 days ago
JSON representation
A tiny XMLHttpRequest wrapper.
- Host: GitHub
- URL: https://github.com/zkochan/tiny-ajax
- Owner: zkochan
- License: mit
- Created: 2015-11-15T13:36:12.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-19T11:19:02.000Z (about 9 years ago)
- Last Synced: 2024-10-26T16:53:52.200Z (3 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tiny-ajax
A tiny XMLHttpRequest wrapper.
[![Dependency Status](https://david-dm.org/zkochan/tiny-ajax/status.svg?style=flat)](https://david-dm.org/zkochan/tiny-ajax)
[![Build Status](https://travis-ci.org/zkochan/tiny-ajax.svg?branch=master)](https://travis-ci.org/zkochan/tiny-ajax)
[![npm version](https://badge.fury.io/js/tiny-ajax.svg)](http://badge.fury.io/js/tiny-ajax)## Installation
```
npm i --save tiny-ajax
```## Usage
```js
var ajax = require('ajax');/* Making a GET request */
ajax.get('http://foo.com/bar', {
data: {
bar: 'bax'
},
success: function(res) {
console.log(res);
},
error: function(err) {
console.error(err);
}
});/* Making a POST request */
ajax.post('http://foo.com/bar?id=23', {
data: {
bar: 'bax'
},
success: function(res) {
console.log(res);
},
error: function(err) {
console.error(err);
}
});/* other requests */
ajax.send('http://foo.com/bar/23', {
method: 'DELETE',
success: function(res) {
console.log(res);
},
error: function(err) {
console.error(err);
}
});
```## License
MIT