# ajax-promise-es6

> Promise based Ajax module for react/react-native apps.

Latest version **3.5.0** (published 2016-10-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install ajax-promise-es6
pnpm add ajax-promise-es6
yarn add ajax-promise-es6
bun add ajax-promise-es6
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.5.0 |
| Published | 2016-10-17 |
| First published | 2016-09-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | dragfire |
| Maintainers | dragfire |
| Keywords | ajax, react, XmlHttpRequest, react-native |

## Links

- npm: https://www.npmjs.com/package/ajax-promise-es6
- Repository: https://github.com/dragfire/ajax-promise-es6
- Homepage: https://github.com/dragfire/ajax-promise-es6#readme
- Issues: https://github.com/dragfire/ajax-promise-es6/issues
- npm.io page: https://npm.io/package/ajax-promise-es6

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 3.5.0 (latest) — 2016-10-17
- 3.1.2 — 2016-09-07
- 3.1.0 — 2016-09-05
- 2.1.2 — 2016-09-04
- 1.2.2 — 2016-09-03
- 1.1.3 — 2016-09-02
- 1.1.2 — 2016-09-02

## README

# ajax-promise-es6
Promise based Ajax module for react/react-native apps.

##Installation:
```npm i -S ajax-promise-es6```

## Usage:

```javascript
// default timeout is 3000ms
// url    : {type: 'string'}
// body   : {type: 'object'}
// headers: {type: 'object', optional: 'true'}

import Ajax from 'ajax-promise-es6'

Ajax.post(url, body, headers).then((res)=> {  
            console.log(res);  
  }).catch((err)=> {
      console.log(err);
  });

Ajax.get(url, body, headers).then((res)=> {  
            console.log(res);  
  }).catch((err)=> {
      console.log(err);
  });

```

##Example:
```javascript
Ajax.post(url,
             {
                foo: 'hello',   // body data
                bar: 'there'
              },
              {
                'Cookie': 'foo=bar'  // headers
              }
    ).then((res)=> {
            // use JSON.parse(res);  
            console.log(res);  
  }).catch((err)=>{
      console.log(err);
  });
```

---
_Source: https://npm.io/package/ajax-promise-es6 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
