2.1.10 • Published 4 years ago

requestapijs v2.1.10

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

Request Api JS

Access json api with ease

Features

Browser Support

ChromeFirefoxSafari
Latest ✔Latest ✔Latest ✔

Installing

Using npm:

$ npm install requestapijs

Using yarn:

$ yarn add requestapijs

Example


Get Request

new Api().get(URLS.COMPANY)
    .setHeader('authorization', localStorage.getItem('token'))
    .success(
      response => { #DO something },
    )
    .error(e => apiErrorHandler(e))
    .done();

Put Request

new Api().put(URLS.COMPANY, id, value)
    .setHeader('authorization', localStorage.getItem('token'))
    .success(
      response => {
        #Do something
      },
    ).error(
      error => { onError && onError(error); apiErrorHandler(error); },
    ).done();

Post

new Api().post(URLS.COMPANY, value)
    .setHeader('authorization', localStorage.getItem('token'))
    .success(
      response => {
        COMPANY_REDUCER.fetchCompany();
        onSuccess && onSuccess(response);
      },
    ).error(
      error => { onError && onError(error); apiErrorHandler(error); },
    ).done();
2.1.10

4 years ago

2.1.9

4 years ago

2.1.8

5 years ago

2.1.7

5 years ago

2.1.6

5 years ago

2.1.5

5 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.0.0

6 years ago

0.9.9

6 years ago

0.9.8

6 years ago

0.9.7

6 years ago

0.9.6

6 years ago

0.9.5

6 years ago

0.9.4

6 years ago

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago