https://github.com/axross/easyagent-next
https://github.com/axross/easyagent-next
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/axross/easyagent-next
- Owner: axross
- License: mit
- Created: 2015-08-20T14:53:50.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-08-31T12:02:40.000Z (about 10 years ago)
- Last Synced: 2025-01-21T14:47:19.118Z (9 months ago)
- Language: JavaScript
- Size: 168 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EasyAgent
[](https://circleci.com/gh/axross/easyagent)
[](http://badge.fury.io/js/easyagent)
[](LICENSE)
EasyAgent is nothing more than a wrapper library of [Fetch API](https://fetch.spec.whatwg.org/), but EasyAgent certainly helps your using fetch API. Anyhow, see [examples](#examples).
## Example
```javascript
EasyAgent.get('/path/to/api', {
method: '',
url: '',
headers: {},
queries: {
q: 'google',
page: 1,
},
body: {},
mode: '',
credentials: '',
cache: '',
})
.fetchJson()
.then(json => console.info(json))
.then(err => console.error(err));
```## Installation
```sh
$ npm i -S easyagent
``````javascript
import EasyAgent from 'easyagent';
```## API
### EasyAgent.get(url, options)
`EasyAgent.post()`
### EasyAgent#fetch()
### EasyAgent#fetchJson()
## License
MIT