# vue-resource

> The HTTP client for Vue.js

Latest version **1.5.3** (published 2021-06-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-resource
pnpm add vue-resource
yarn add vue-resource
bun add vue-resource
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.3 |
| Published | 2021-06-14 |
| First published | 2015-06-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 175.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9978 |
| Maintainers | yyx990803, steffans |
| Keywords | vue, xhr, http, ajax |

## Links

- npm: https://www.npmjs.com/package/vue-resource
- Repository: https://github.com/pagekit/vue-resource
- Issues: https://github.com/pagekit/vue-resource/issues
- npm.io page: https://npm.io/package/vue-resource

## Dependencies (1)

- [got](https://npm.io/package/got.md) >=8.0 <12.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.5.3 (latest) — 2021-06-14
- 1.5.2 — 2021-03-02
- 1.5.1 — 2018-05-20
- 1.5.0 — 2018-03-03
- 1.4.0 — 2018-02-22
- 1.3.6 — 2018-02-11
- 1.3.5 — 2017-12-20
- 1.3.4 — 2017-06-08
- 1.3.3 — 2017-05-22
- 1.3.2 — 2017-05-22
- 1.3.1 — 2017-04-09
- 1.3.0 — 2017-04-06
- 1.2.1 — 2017-02-28
- 1.2.0 — 2017-02-05
- 1.1.2 — 2017-02-02
- … 36 more at https://npm.io/package/vue-resource/versions

## README

# vue-resource [![Build](https://circleci.com/gh/pagekit/vue-resource.svg?style=shield)](https://circleci.com/gh/pagekit/vue-resource) [![Downloads](https://img.shields.io/npm/dm/vue-resource.svg)](https://www.npmjs.com/package/vue-resource) [![jsdelivr](https://data.jsdelivr.com/v1/package/npm/vue-resource/badge?style=rounded)](https://www.jsdelivr.com/package/npm/vue-resource) [![Version](https://img.shields.io/npm/v/vue-resource.svg)](https://www.npmjs.com/package/vue-resource) [![License](https://img.shields.io/npm/l/vue-resource.svg)](https://www.npmjs.com/package/vue-resource)

The plugin for [Vue.js](http://vuejs.org) provides services for making web requests and handle responses using a [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) or JSONP.

## Features

- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API and [URI Templates](https://medialize.github.io/URI.js/uri-template.html)
- Supports [interceptors](docs/http.md#interceptors) for request and response
- Supports latest Firefox, Chrome, Safari, Opera and IE9+
- Supports Vue 1.0 & Vue 2.0
- Compact size 14KB (5.3KB gzipped)

## Installation
You can install it via [yarn](https://yarnpkg.com/) or [NPM](http://npmjs.org/).
```
$ yarn add vue-resource
$ npm install vue-resource
```

### CDN
Available on [jsdelivr](https://cdn.jsdelivr.net/npm/vue-resource@1.5.3), [unpkg](https://unpkg.com/vue-resource@1.5.3) or [cdnjs](https://cdnjs.com/libraries/vue-resource).
```html
<script src="https://cdn.jsdelivr.net/npm/vue-resource@1.5.3"></script>
```

## Example
```js
{
  // GET /someUrl
  this.$http.get('/someUrl').then(response => {

    // get body data
    this.someData = response.body;

  }, response => {
    // error callback
  });
}
```

## Documentation

- [Configuration](docs/config.md)
- [HTTP Requests/Response](docs/http.md)
- [Creating Resources](docs/resource.md)
- [Code Recipes](docs/recipes.md)
- [API Reference](docs/api.md)

## Changelog

Details changes for each release are documented in the [release notes](https://github.com/pagekit/vue-resource/releases).

## Contribution

If you find a bug or want to contribute to the code or documentation, you can help by submitting an [issue](https://github.com/pagekit/vue-resource/issues) or a [pull request](https://github.com/pagekit/vue-resource/pulls).

## License

[MIT](http://opensource.org/licenses/MIT)

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