Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pagekit/vue-resource
The HTTP client for Vue.js
https://github.com/pagekit/vue-resource
http-client javascript vue vue-resource
Last synced: about 1 month ago
JSON representation
The HTTP client for Vue.js
- Host: GitHub
- URL: https://github.com/pagekit/vue-resource
- Owner: pagekit
- License: mit
- Archived: true
- Created: 2014-02-07T23:07:56.000Z (almost 11 years ago)
- Default Branch: develop
- Last Pushed: 2022-12-08T21:37:18.000Z (almost 2 years ago)
- Last Synced: 2024-09-25T11:37:37.552Z (about 1 month ago)
- Topics: http-client, javascript, vue, vue-resource
- Language: JavaScript
- Homepage:
- Size: 1.68 MB
- Stars: 10,083
- Watchers: 258
- Forks: 1,602
- Open Issues: 113
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-vue-cn - **vue-resource ★1,162** - AJAX/Resource plugin maintained by the [PageKit](http://pagekit.com/) team. <sup>1.0 compatible</sup> (Awesome Vue.js [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) / Libraries & Plugins)
- awesome-github-star - vue-resource
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/[email protected]), [unpkg](https://unpkg.com/[email protected]) or [cdnjs](https://cdnjs.com/libraries/vue-resource).
```html```
## 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)